Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 18th, 2005, 7:35 PM   #1
rpg_code_master
Newbie
 
Join Date: Apr 2005
Location: Milton Keynes - England
Posts: 9
Rep Power: 0 rpg_code_master is on a distinguished road
Send a message via MSN to rpg_code_master
C++ Long, and Visual Basic Long

Hello

I am interfacing a VB ActiveX DLL with C++ via COM. It compiles and links, but it does not run correctly. I can successfully get the desired interface via CoCreateInstance. When I try though, to pass a Long into one of the VB interfaced functions, I get a 'Cannot read from 0x...' error. Have you any ideas as to why? Maybe a C++ Long != a VB Long…?

Thank you
rpg_code_master is offline   Reply With Quote
Old Aug 18th, 2005, 8:36 PM   #2
Scorpions4ever
Programmer
 
Join Date: Jun 2005
Posts: 86
Rep Power: 4 Scorpions4ever is on a distinguished road
On a 32 bit VC++ compiler, VC++ long = VB Long.
Scorpions4ever is offline   Reply With Quote
Old Aug 19th, 2005, 4:09 AM   #3
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 894
Rep Power: 4 The Dark is on a distinguished road
Is the VB function parameter passed by reference or passed by value? It may be that you are passing the value of the long and the VB DLL is trying to treat it as an address.
The Dark is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:38 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC