Click here to Skip to main content
15,922,584 members
Home / Discussions / COM
   

COM

 
GeneralRe: Forward declaration of interfaces Pin
Rowan Seymour10-Sep-03 6:11
Rowan Seymour10-Sep-03 6:11 
GeneralRe: Forward declaration of interfaces Pin
Brian Shifrin11-Sep-03 1:35
Brian Shifrin11-Sep-03 1:35 
GeneralRe: Forward declaration of interfaces Pin
Rowan Seymour11-Sep-03 3:34
Rowan Seymour11-Sep-03 3:34 
GeneralRe: Forward declaration of interfaces Pin
arun140529-Oct-03 2:18
arun140529-Oct-03 2:18 
GeneralRe: Forward declaration of interfaces Pin
Rowan Seymour29-Oct-03 2:58
Rowan Seymour29-Oct-03 2:58 
GeneralIE Automation Pin
nikhilkhedkar8-Sep-03 21:08
nikhilkhedkar8-Sep-03 21:08 
GeneralRe: IE Automation Pin
nikhilkhedkar9-Sep-03 2:18
nikhilkhedkar9-Sep-03 2:18 
GeneralStack messed up upon function returned Pin
DionChen8-Sep-03 8:04
DionChen8-Sep-03 8:04 
Hi, all:

I have a weird problem and need your help. I have a main app and DLL. In the main app I have my object pointer (CMyObj* pObj) that has method like:

HRESULT TranslateIDToName( long lID, LPSTR cBuff, UNIT dwBuffSize );

this TranslateIDToName then calls some methods in DLL.

In main, I have something like this:

const DWORD dwBuffSize = 128;
TCHAR cBuff[dwBuffSize];
pObj->TranslateIDToName( lID, cBuff, dwBuffSize );

When I compile both main app and DLL in RELEASE, (both uses Multithreaded DLL as Runtime DLL ). It works fine! However, if I compile both in Debug ( both uses Debug Multithreaded DLL ), I step through the code, The TranslateIDToName() fills up the cBuff correctly and then return from the function.

The problem comes when the function returns to the caller:

pObj->TranslateIDToName( lID, cBuff, dwBuffSize );

The pObj is trashed with either garbage in the pObj or pObj = NULL. In either case, the pObj address changes before calling the method and right after return from the method ( the Stack really messed up!!). Of course, the app crashes!

I tried all the stuff I can think of, and no more ideas about what could be wrong.

Any suggestion and help will be highly appreciated. Thanks in advance.

Dion

QuestionHow to pass VBA Collection to COM DLL from .NET C#? Pin
ajkumar4-Sep-03 15:21
ajkumar4-Sep-03 15:21 
Generalpassing a pointer into C++ from VB Pin
rajdawg3-Sep-03 16:31
rajdawg3-Sep-03 16:31 
GeneralRe: passing a pointer into C++ from VB Pin
Lim Bio Liong18-Sep-03 7:51
Lim Bio Liong18-Sep-03 7:51 
GeneralThreading issue Pin
kkfromus2-Sep-03 11:16
kkfromus2-Sep-03 11:16 
GeneralRe: Threading issue Pin
valikac3-Sep-03 6:22
valikac3-Sep-03 6:22 
GeneralRe: Threading issue Pin
kkfromus3-Sep-03 11:35
kkfromus3-Sep-03 11:35 
GeneralRe: Threading issue Pin
valikac4-Sep-03 9:07
valikac4-Sep-03 9:07 
GeneralRe: Threading issue Pin
Anonymous12-Sep-03 12:16
Anonymous12-Sep-03 12:16 
GeneralRe: Threading issue Pin
kkfromus12-Sep-03 14:40
kkfromus12-Sep-03 14:40 
GeneralThread Id of client app Pin
In-At1-Sep-03 18:30
In-At1-Sep-03 18:30 
GeneralRe: Thread Id of client app Pin
igor19603-Sep-03 10:33
igor19603-Sep-03 10:33 
Generalwhy CoCreateInstance( ... IID_IShellLink, ..) failed Pin
nofeel1-Sep-03 16:41
nofeel1-Sep-03 16:41 
GeneralRe: why CoCreateInstance( ... IID_IShellLink, ..) failed Pin
PengFeidu7-Sep-03 20:08
PengFeidu7-Sep-03 20:08 
GeneralRe: why CoCreateInstance( ... IID_IShellLink, ..) failed Pin
Lim Bio Liong18-Sep-03 8:06
Lim Bio Liong18-Sep-03 8:06 
GeneralRe: why CoCreateInstance( ... IID_IShellLink, ..) failed Pin
Lim Bio Liong19-Sep-03 0:53
Lim Bio Liong19-Sep-03 0:53 
GeneralKeeping COM server active Pin
Gilrock1-Sep-03 14:00
Gilrock1-Sep-03 14:00 
GeneralRe: Keeping COM server active Pin
igor19603-Sep-03 10:43
igor19603-Sep-03 10:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.