msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VB6 and Win32 DLL interaction

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
Bartholomew Simpson



Joined: 04 Oct 2007
Posts: 7

PostPosted: Fri Jun 22, 2007 11:51 pm    Post subject: VB6 and Win32 DLL interaction Reply with quote

I am writing a VB6 frontend to my application. The backend is written in
C/C++. I have exposed some classes via a C API to VB. The library has
functions that return pointers to data structures and objects in the
Win32 DLL - nothing unusual there.

However, I am then wrapping up the exposed function in VB6 classes.

Using the plain API (without wrapping the C++ objects in a VB6 class), I
have code that looks like this :


dim lngPtr as long
lngPtr = CreateNewObject() 'calls Dll function


With the exposed C functions wrapped up in VB6 classes, the code looks
something like this:

dim objMyStuff as MyStuff

// which of these statements are correct?
objMyStuff = CreateNewObject() //OR
Set objMyStuff = CreateNewObject()

The VB6 class will hold the pointer as a private variable - and fre the
pointer when the object is going out of scope - in its Terminate()
event. What is not clear to me is how to assign the pointer
automatically from functions that return a pointer.

I dont want to have a user to explicitly set the pointer via a property
or method, I want to be able to assign the pointer via a function call,
so that the (VB) side of the code is simple and will allow a function
returning the pointer to allow the object to start being used ...
comments welcome

Archived from group: microsoft>public>vb>enterprise
Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Vista vs Win32 API - reference? I have a number of VB (and VC++) app's that use lots of WIN32 API calls. Now, I've been asked to get them working on Vista, but without Admin. privileges and I'm expect lots of trouble. Are there any references that I can rummage through that list which A

VB6 - why isnt a straight Win32 DLL offered as a project typ Hi Why isnt a straight Win32 DLL offered as a project type? I dont want a create a Active X Win32 DLL. I want to create a non-Active X straight Win32 DLL in VB. You can do that in VC++ 6.0? So why cant you do that in VB 6.0? Any URLs on this would be usef

Interaction with Outlook I have a proc written in a Lotus application that automates sending email from a Lotus database to Outlook. The email address and the data are stored in the Lotus app and simply ported to an Outlook message. The code executed in Lotus script looks like t

New problem - interaction between control arrays (long) One day, this will all be behind me and I'll look back ruefully at the hours that I wasted on this b####y project ...... I have a form with four seperate control arrays of option buttons. The form is used to (a) enable user configuration selection; (b) d

Win32 API on XP When I paste the declaration for function, VB6 throws away the Alias and then gives me an error ("Sub or Function not defined")when I run the program. I have tried to type it in and save it, but it still throws it away. Is there a wor
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group