Click here to Skip to main content
15,906,467 members
Home / Discussions / COM
   

COM

 
QuestionOutlook Add ins Pin
Jerome.Mariadoss12-Dec-07 1:19
Jerome.Mariadoss12-Dec-07 1:19 
GeneralRe: Outlook Add ins Pin
KarstenK12-Dec-07 2:51
mveKarstenK12-Dec-07 2:51 
GeneralIWebBrowser2 Behavior is Different from IE7 in Vista Pin
chunsj11-Dec-07 19:41
chunsj11-Dec-07 19:41 
QuestionNumber Problem...... Pin
Peter Parker11-Dec-07 3:44
Peter Parker11-Dec-07 3:44 
GeneralIntercept Send Mail in Outlook Pin
_AnsHUMAN_ 10-Dec-07 21:13
_AnsHUMAN_ 10-Dec-07 21:13 
GeneralRe: Intercept Send Mail in Outlook Pin
myshketer11-Dec-07 21:11
myshketer11-Dec-07 21:11 
QuestionSmart Tag Creation Pin
anufabian9-Dec-07 22:50
anufabian9-Dec-07 22:50 
GeneralSending string from COM to C# under Vista problem Pin
Stevo Z6-Dec-07 22:53
Stevo Z6-Dec-07 22:53 
Hi,

I'm experiencing and issue regarding System.AccessViolationException : Attempted to read or write protected memory that occurs since Vista. On XP's or previous, everything run fine. To be more specific. I have a C++ ATL/COM object (created in VS 6) that is wrapped in C# .NET 2.0 . Problem occurs when handling Strings.

I've created COM using standard tools in VS 6.


this is the method definition from Interface IDL file :
[id(9), helpstring("method GetString")] HRESULT GetString([out] LPSTR* word, [out, retval] int* count);


Inferface .h Header file :
STDMETHOD(GetString)(/*[out]*/ LPSTR* word, /*[out, retval]*/ int* count);


Code Inferface.c file :
STDMETHODIMP CLicenser::GetString(LPSTR* word, int *count)
{
     // helper class is some class that provides information that we need...

     *count = this->helperClass.GetCount();  // count works fine anytime.
   
     *word = this->helperClass.GetWord();  // this causes Attemped to read or write protected memory...
     // *word = "some text";  // !!! this works fine, if former line is commented out, this method throws
                                           // no Exception !!!.

     cout << "word:" << *word << endl;  // word is displayed correctly in console window (Console is created by
                                        //C# application) everytime
   
     return S_OK;
}


Method definition in C# wrapper looks like:
int IClassNameObject.GetString(out string);


Anytime this method is called, it finishes properly (also including that Console output word:[whatever word contains]), besides in Vista, it throws that System.AccessViolationException with name of that (GetString) method after it finishes.


Method is Supposed to return a count and fill a supplied string.


If u need I can create sample project / dll , I don't have one now....

zilo

QuestionRe: Sending string from COM to C# under Vista problem Pin
Nathan Holt at EMOM7-Dec-07 7:28
Nathan Holt at EMOM7-Dec-07 7:28 
GeneralRe: Sending string from COM to C# under Vista problem Pin
Mike Dimmick7-Dec-07 16:36
Mike Dimmick7-Dec-07 16:36 
GeneralRe: Sending string from COM to C# under Vista problem Pin
Stevo Z10-Dec-07 2:20
Stevo Z10-Dec-07 2:20 
GeneralSending array from C# to ActiveX component Pin
Hampus@foi6-Dec-07 20:49
Hampus@foi6-Dec-07 20:49 
AnswerRe: Sending array from C# to ActiveX component Pin
Nathan Holt at EMOM7-Dec-07 7:32
Nathan Holt at EMOM7-Dec-07 7:32 
GeneralRe: Sending array from C# to ActiveX component Pin
Hampus@foi9-Dec-07 22:27
Hampus@foi9-Dec-07 22:27 
GeneralRe: Sending array from C# to ActiveX component Pin
Nathan Holt at EMOM10-Dec-07 7:15
Nathan Holt at EMOM10-Dec-07 7:15 
GeneralRe: Sending array from C# to ActiveX component Pin
User 2155977-Dec-07 11:52
User 2155977-Dec-07 11:52 
GeneralSaving Powerpoint Slide as Bitmap From A Win32 sdk application(NON MFC) Pin
niloy5-Dec-07 18:24
niloy5-Dec-07 18:24 
QuestionCan a COM component be made that will bind to multiple columns in a DB table? Pin
chuckles_net3-Dec-07 11:24
chuckles_net3-Dec-07 11:24 
GeneralClass not registered error Pin
Royce Fickling3-Dec-07 10:31
Royce Fickling3-Dec-07 10:31 
GeneralRe: Class not registered error Pin
User 2155973-Dec-07 10:54
User 2155973-Dec-07 10:54 
QuestionSpecialized OLE container Control Pin
LLINF1-Dec-07 3:41
LLINF1-Dec-07 3:41 
QuestionNULL modem program Pin
AKYap30-Nov-07 17:50
AKYap30-Nov-07 17:50 
QuestionFatal Error Handling Pin
Nathan Holt at EMOM27-Nov-07 6:37
Nathan Holt at EMOM27-Nov-07 6:37 
AnswerRe: Fatal Error Handling Pin
User 21559727-Nov-07 7:44
User 21559727-Nov-07 7:44 
GeneralRe: Fatal Error Handling Pin
Nathan Holt at EMOM27-Nov-07 9:10
Nathan Holt at EMOM27-Nov-07 9:10 

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.