|
-
Dec 19th, 2001, 09:30 PM
#1
Thread Starter
Addicted Member
Creating Instance
Goodday everybody...
I'm not sure this is the right forum to put in....
I've a COM DLL created in VB and I'm linking it from an EXE created in VC++. I created a COM object of 'Connection' in VC++, which is the equivalent of 'adodc.Connection' in VB.
Following is the code on how I created my object:
_ConnectionPtr m_pConnect;
HRESULT hr = m_pConnect.CreatedInstance(__uuidof(Connection));
after that I pass a reference of this object to the COM DLL using the class function available from the COM DLL.
Now the problem is, it seems that the 'm_pConnect' object has not been allocated a memory space. In other words, the instance of the object has not been created because the following error occur when I try to use the 'm_pConnect' object:
'Object variable or with block variable not set'
Of course, I can overcome this by creating an instance of the object using 'New' in VB. But I do not want to do that. So, is there any code or function that I can use in VC++ to overcome this problem?
Thanks...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|