Click here to Skip to main content
15,890,690 members
Home / Discussions / COM
   

COM

 
GeneralRe: pass character string to COM Pin
MKUser29-Jun-08 22:50
MKUser29-Jun-08 22:50 
GeneralRe: pass character string to COM Pin
Vi229-Jun-08 23:14
Vi229-Jun-08 23:14 
GeneralRe: pass character string to COM Pin
MKUser29-Jun-08 23:45
MKUser29-Jun-08 23:45 
GeneralRe: pass character string to COM Pin
Vi230-Jun-08 21:04
Vi230-Jun-08 21:04 
GeneralRe: pass character string to COM Pin
MKUser1-Jul-08 3:20
MKUser1-Jul-08 3:20 
GeneralRe: pass character string to COM Pin
Vi21-Jul-08 17:40
Vi21-Jul-08 17:40 
GeneralRe: pass character string to COM Pin
MKUser1-Jul-08 18:42
MKUser1-Jul-08 18:42 
GeneralRe: pass character string to COM Pin
MKUser1-Jul-08 21:22
MKUser1-Jul-08 21:22 
I implement one function in COM which allocate some memory to array and return this.
int AllocateData(int length, BSTR* OutArray)
{
// there is some data in a ansi array, i return this data from this COM function

wchar_t* wstr = (wchar_t*)calloc(sizeof(WCHAR),length+1);
MultiByteToWideChar(CP_ACP, 0, ansiarray, length, wstr, length) ; free(ansiarray);
*OutArray = (BSTR)wstr;
}

When i use this dll i call this function like
BSTR st;
st = cominterface->AllocateData(500);
When this function is called i get some error for memory leak. Please suggest how to fix it.

Manoj Kumar Chauhan

GeneralRe: pass character string to COM Pin
CPallini1-Jul-08 22:05
mveCPallini1-Jul-08 22:05 
GeneralRe: pass character string to COM Pin
MKUser1-Jul-08 23:19
MKUser1-Jul-08 23:19 
QuestionRe: pass character string to COM Pin
CPallini1-Jul-08 23:33
mveCPallini1-Jul-08 23:33 
AnswerRe: pass character string to COM Pin
MKUser2-Jul-08 19:53
MKUser2-Jul-08 19:53 
GeneralRe: pass character string to COM Pin
CPallini2-Jul-08 21:18
mveCPallini2-Jul-08 21:18 
GeneralRe: pass character string to COM Pin
MKUser2-Jul-08 21:56
MKUser2-Jul-08 21:56 
GeneralRe: pass character string to COM Pin
CPallini2-Jul-08 22:08
mveCPallini2-Jul-08 22:08 
GeneralRe: pass character string to COM Pin
MKUser2-Jul-08 22:58
MKUser2-Jul-08 22:58 
GeneralRe: pass character string to COM Pin
Vi22-Jul-08 22:08
Vi22-Jul-08 22:08 
GeneralRe: pass character string to COM Pin
MKUser2-Jul-08 23:02
MKUser2-Jul-08 23:02 
GeneralRe: pass character string to COM Pin
Vi22-Jul-08 17:38
Vi22-Jul-08 17:38 
GeneralRe: pass character string to COM Pin
CPallini1-Jul-08 22:08
mveCPallini1-Jul-08 22:08 
GeneralRe: pass character string to COM Pin
CPallini1-Jul-08 3:25
mveCPallini1-Jul-08 3:25 
QuestionHow to add another activex control to web page dynamically. Pin
vies0028-Jun-08 22:28
vies0028-Jun-08 22:28 
AnswerRe: How to add another activex control to web page dynamically. Pin
pascal9181-Mar-10 16:48
pascal9181-Mar-10 16:48 
QuestionDefine a enum type variable on the Interface (ATL project) ? Pin
iman_kh27-Jun-08 10:31
iman_kh27-Jun-08 10:31 
AnswerRe: Define a enum type variable on the Interface (ATL project) ? Pin
Stephen Hewitt1-Jul-08 15:03
Stephen Hewitt1-Jul-08 15:03 

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.