newbie question on MFC AtciveX control wizard


I am working on a MFC ActiveX Control wizard generated project. Is there a
way to make a method to return a class to VB client?   Say I have a class in
VC++ named CCustomer, it has a lot of  member varaibles,   right now I am
mapping each variable to a property of the ActiveX control.


rdrd (12)
7/28/2004 4:38:17 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 14

Try creating a "method" for your ActiveX control that has a return type or
either LPUNKNOWN or VARIANT. With this Method, return a CCustomer class.  In
VB,  define the same CCustomer class and assign it to the resulting method

There will be some pointer/object conversions you will need to workout.

Hope that helps

"Raymond Du" <> wrote in message
> Hi,
> I am working on a MFC ActiveX Control wizard generated project. Is there a
> way to make a method to return a class to VB client?   Say I have a class
> VC++ named CCustomer, it has a lot of  member varaibles,   right now I am
> mapping each variable to a property of the ActiveX control.

PinHead1 (35)
7/29/2004 6:24:41 PM
You need to turn the CCustomer class into a com object (or create a com
object that wraps the CCustomer methods) and expose a method/property on
your active X control to return the object.

"Raymond Du" <> wrote in message
> Hi,
> I am working on a MFC ActiveX Control wizard generated project. Is there a
> way to make a method to return a class to VB client?   Say I have a class
> VC++ named CCustomer, it has a lot of  member varaibles,   right now I am
> mapping each variable to a property of the ActiveX control.

huw5231 (1)
8/2/2004 2:27:01 PM

Similar Artilces:

Please help with Excel VB question
Hi, I'm trying to set a Name range in Excel through VB, by setting the name property when a specific cell in a worksheet is changed. The code is as follows: fred1 = CStr("=PL!$A$4:$E$" Worksheets("Control").Range("maxnumpass").Value) ActiveWorkbook.Names.Add Name:="numpasslist", RefersTo:=fred1 My problem is that the change is only active for the worksheet where I change the cell. Is it possible to ensure that this change takes effect across all worksheets in the workbook? Any and all help appreciated either in a reply to this post or on jgal...

Multithreading Question
Hi, I am writing a multithreaded server application. I have written a class to handle thread(CThread , say) activities like creating, suspending, resuming threads etc. I have derived a class from CThread (CMainThread, say) and a class (CClientThread, say) to handle client connection which is also derived from CThread. In CMainThread class i am creating a thread and waiting for incomming connections. As soon as a connection came i am creating an object for CClientThread and call the function to create a thread and so on. code flow: 1. Start the main listening thread. 2. wait for a con...

MS CRM Certification question
Hi all, I have a question regarding the CRM certification? What, if any, certifications are there available with MS CRM? Is there anything like CRM Professional? Have I earned any certification if I passed the Applications Professional exam? T.I.A -- Kuba Skalbania [MCAD] ...

update trigger question
If I have something like this in an update trigger: if update(FirstName) or update(LastName) begin update n set FullName = i.FirstName + ' ' + i.LastName from Names n inner join inserted i on n.NameID = i.NameID end I only want FullName to update if either FirstName or LastName are updated. Here's my question. A batch update updates 50 rows in the table. Of the 50, only 20 have changes made to the FirstName or LastName columns. It's my understanding that the "if update()" ONLY allows 20 rows that fit the if update criteria to be updated in the...

Newbie, accnts. payable & accnts.receivable sample DB
Hi guys, I�m running access 2003, windows xp pro SP2 I've been commission in my work to do a small application to track and report the accounts payable and accounts receivable movements, I'm not an accounting savvy person :(, does anyone know of a link or sample access database that can help me with the basic structure of the tables and reports?, any help would be greatly appreciated. Thanks ...

Really simple questions re CSliderCtrl
Using SetSelection() I can get a CSliderCtrl to display a highlighted selection ... but so what? What use is it other than to look pretty? Which of the following is possible, and how do I do them? (1) Prevent the user from moving the thumb outside the highlighted range. (This seems to be what the documentation suggests that SetSelection does, but in fact it doesn't, the thumb can be moved outside the selection.) (2) Have the user change the selection. (The documentation seems to suggest this is possible, but I can find no combination of keystrokes or mouse actions that will do it.) -- ...

multithreading question
I drive my game's physics engine using a simple loop running on its own thread. It invokes Thread.Sleep(1) when processing takes little or no time (under 4ms) to allow real time to catch up. For heavier loads the loop uses bigger timeslices, up to 20ms, with no sleeps. Since this is a multithreaded application, I decided to break out CHESS to test the object (render) buffer for problems. But CHESS hates Thread.Sleep() - it fails any test that hits one, calls it a livelock. I ended up switching out the original realtime loop with a high resolution multimedia timer, but I ...

Email Setup Questions
Howdy and Happy New Year! I just bought a new computer and I'm trying to set up Outlook. Other than logging onto work email using the internet from a hotel o at home, I've never used Outlook away from work. I have several different email accounts: Hotmail, AOL, and work emai (which uses Outlook). Is it possible to utilize Outlook to retrieve my emails from th separate accounts? Can I setup each of the folders for the differen email accounts all on the left side? After I set it up, how does Outlook know which account I'm using when send email? Hotmail? Work? I need h...

MFC memory leak, + return code help
Hi, I don`t use MFC often so maybe I`m asking a dumb question. I started noticing VC++6 reporting a memory leak when I ran the program in debug mode. Detected memory leaks! Dumping objects -> {27} normal block at 0x009A04C0, 33 bytes long. Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD {26} normal block at 0x009A0510, 40 bytes long. Data: < |L > 14 7C 4C 10 16 00 00 00 00 00 00 00 00 00 00 00 Object dump complete. Strange thing is I`m getting the same error in many of my MFC programs. So I tried removing parts of my code bit by bi...

Visio Newbie
Hello all, this is my first time using Visio for drawing a floor plan and I have a quick question. Yesterday, (Using a tape measure) I mapped out the floor plan of an office my company might be moving into. I wrote everything down in Inches. Is there a way once I get a room shape kinda close to teh measurements, that I can manually type in teh length for each wall? if not in inches, at least in feet. For example, I have one wall that is 154 inches ( 12.83 ft) Then the next wall is 242 incehs( 20.1 ft) The opposite wall of the first measurement is 288 inches, third wall 100 inches, then 13...

Strething bitmaps in MFC
Hi, I am using CBitmapButton in my dialog based application. CBitmapButtton provides a method named SizeToContent() which changes the size of button to that of the bitmap. What I need is the opposite funtionality i.e. the bitmap should be resized/stretched to the button's size. Does any one have any idea how to achieve this. Thanx in advamce. Wasif Ali try CDC::StretchBlt -- With Regards Alok Gupta Visit me at "I Believe this will Help" "Wasif Ali" <> wrote in message news:#Be5VDCNFHA...

General design question
hi! i'd like to design a class - let's call it CDrawObject - that is able to contain some data and draw itself. furthermore i'd like to have a class CDrawMultiObject that is derived from CDrawObject and can contain objects of type CDrawObject. i imagine to have the following situation: CDrawMultiObject -> base object (i.e. an object manager ) CDrawObject -> first element CDrawObject -> secound element CDrawMultiObject -> third element CDrawObject -> first element CDrawObject...

Exchange newbie problem
Hi all; A user on our domain was deleted when he should not have been. His mail box was not deleted. When his account was recreated, we tried to reconnect the old mailbox. But when selecting a user in the "Select a new user for this mailbox" dialog a message comes back saying that the user cannot be found. We tried several different users a none can be found even though they can get there mail just fine. We need to get the messages from this mailbox. Any ideas would be great -- Craig in the High Desert. But it's a dry heat. you should be able to reconnec...

C++ / Access Newbie
Hi Folks... I have a small commercial package written in C++ (targeted to Windows platforms) that uses its own proprietary database. We are just starting to investigate the option of replacing our database with a commercial package, such as Access or MySQL. Can anyone recommend informative reading that provides details on programming C++ with either of these two databases? At this stage we have no (any I mean ZERO) experience such programming. Any information would be helpful: recommendations for Access over MySQL (or vice versa), sources of such comparisons, licensing considerations, OD...

Printing question
We are having an issue with LPR printing using our software in conjucntion with a Windows 2008 server which is preventing us from being able to flash images to a printer from our application. We use Universe, SB+ and SBClient and would use the DOS shell from inside SBClient to use LPR print commands to send the images to the printer, this has worked fine on all other Windows servers but not 2008. What happens is when you drop to DOS you can browse to the %systemroot%\system32 folder and do a dir but you cannot see LPR. If you do the same from a normal command prompt the file ...

General Question
Is this the only way to get Outlook help without having to pay? There are lots of websites with information posted. for one. Of course there's always And the online help files in Outlook. (Press F1) -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Amy" <> wrote in message news:03c701c3a959$cafe41f0$a3012...

Help with Excel ActiveX listbox controls
Hi! I�m trying to create listboxes that displays data from a named range spanning multiple columns. I am able to populate the listbox with data and use it without any problems. However, if the sheet that contains the listboxes changes, the size/dimensions of the listbox unexpectedly also changes. Since I have not written any procedures that control the height/width properties of the listboxes, I cannot determine why the dimensions of the listboxes are changing. I have attached a spreadsheet that illustrates this problem. When you open the spreadsheet, you should see two listboxes named Lis...

2 Macro Questions
If I assign a macro to a forms button on the sheet if I copy the book and load it on my friends computer do the macros go with them. Can a macro button be assign to a cell so when clicked it will print (72,8) from that cell, and what formula would I need? -- Thanks in advance for your help....Bob Vance .. .. .. .. Hi Bob 1. Yes, the macro code is copied as well 2. You can add some code to the Doubleclick event of your button. I'm not so sure what you mean with 'print'? Insert a value in a specific cell. If yes, try the following code: Private Sub CommandButton1_Click() Me...

joining the group Hey Newbie where are you from and what versiona re you using? Fliehigh "" wrote: > joining the group > ...

Reference control unless focus problem
I have a form that opens in the edit mode. I have an unbound image control and a bound textbox with the path to the picture stored in the table. I want the picture to display on each record as I scroll through the records. I have the following code in the OnCurrent property of the image control (EditPic). When I open the form I get the following message: "You can't reference a property or method for a control unless the control has the focus." How can I make this work correctly. Thank you. Private Sub Form_Current() Me.EditPic.Picture = Me.txtPicPath.Text End Sub &q...

Run Integration Quicker-Newbie
I am running an integration to import sales orders for invoicing. I use several additional query criteria in IM, but I do not think these criteria are passed to SQL Server 2000. Instead, the records are returned, then the criteria are applied. The integration is taking quite a bit of time to run. Does anyone have an idea on how to pass the criteria to SQL Server, or any other ideas to increase the performance? Thanks. use a SQL Server View "Shannon LeVert" <> wrote in message news:06c701c46daa$fbad4100$a501280a@phx.gbl... > I am running an in...

Off topic question
Which newsgroup should I subscribe to ask questions about newsgroups? What sorts of questions? About the groups themselves? About Usenet? About newsreaders such as Outlook Express (which I see you're using)? -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "Jim Birke .com>" <jimbir@yahoo<notthis> wrote in message news:eELhwFfqKHA.728@TK2MSFTNGP04.phx.gbl... > Which newsgroup should I subscribe to ask questions about newsgroups? > > I am subscribed to several newsgroups in msn...

XSL Question #5
<xsl:if test="fTOC[starts-with(@filename, '5')]"> <xsl:element name="Section1"> <xsl:attribute name="titleRef">Section 1 - Section One</xsl:attribute> <xsl:for-each select="fTOC[starts-with(@filename, '5')]"> <xsl:copy-of select="."/> </xsl:for-each> </xsl:element> </xsl:if> I am going through a list of files starting with '5' and placing them under "Section 1 - Se...

Question About PF migration
Hi All, I want to migrate PF from Exchange 5.5 to Exchange 2003. I saw that using the PFMIGRATE utility I can create replica on the destenation server, but I can't define which folders I want (I can only define the number of folders) Is there any utility / script that I can use to define list of folders? Thanks, Nir B Greetings Nir We cannt use PFmigrate to do a selective replication but what can be done is the contect replication of selective PF using if its an intra-org pf migration by simply useing Exchange System Manager and right-click the PF you want to replicate and on the...

MDI newbie ?
I want to add a "reload" command that will close the current(and only) document and reload it again. Here is what I have tried so far: <code> AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_FILE_NEW); while(AfxGetApp()->GetOpenDocumentCount() > 0); AfxGetApp()->OpenDocumentFile(currentFluPath); </code> This doesn't work, because, as I've learned ID_FILE_NEW create just that, a new blank document so count is still 1. I can't figure out what I should check for, how I can know when the ID_FILE_NEW is done so that I can call OpenDocumentFile() Does ...