Click here to Skip to main content
15,911,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: Casting in C# Pin
Luc Pattyn16-Apr-07 13:33
sitebuilderLuc Pattyn16-Apr-07 13:33 
GeneralRe: Casting in C# Pin
Russell Jones16-Apr-07 23:39
Russell Jones16-Apr-07 23:39 
QuestionVersionInfo? Pin
Ravi Bhavnani16-Apr-07 8:51
professionalRavi Bhavnani16-Apr-07 8:51 
AnswerRe: VersionInfo? Pin
Tarakeshwar Reddy16-Apr-07 9:01
professionalTarakeshwar Reddy16-Apr-07 9:01 
GeneralRe: VersionInfo? Pin
Ravi Bhavnani16-Apr-07 9:22
professionalRavi Bhavnani16-Apr-07 9:22 
AnswerRe: VersionInfo? Pin
Judah Gabriel Himango16-Apr-07 9:34
sponsorJudah Gabriel Himango16-Apr-07 9:34 
GeneralRe: VersionInfo? Pin
Ravi Bhavnani16-Apr-07 9:55
professionalRavi Bhavnani16-Apr-07 9:55 
Questionpinvoke COM function and damaged memory [modified] Pin
realmontanakid16-Apr-07 8:46
realmontanakid16-Apr-07 8:46 
Hello,

i pinvoke a function from an com api. The function needs two parameters, an com interface and one out parameter. The prototype from the function is

BOOL WINAPI theFunc(theObject* pObject, LPTSTR szName);

My Call
<br />
[System.Runtime.InteropServices.DllImport("mydll.dll")]<br />
        static extern unsafe bool theFunc([MarshalAs(UnmanagedType.Interface)] theItem item, StringBuilder buffer);<br />
<br />
StringBuilder buffer = new StringBuilder(1024);<br />
                    try<br />
                    {<br />
                        bRet = teFunc(_o, buffer);<br />
                    }...<br />


In a normal Windows Application there is no error. The error occured only when i use the code in a c# Windows service. The exception is that the memory might be damaged... AccessViolationException

Any ideas?


-- modified at 14:54 Monday 16th April, 2007
AnswerRe: pinvoke COM function and damaged memory Pin
led mike16-Apr-07 9:12
led mike16-Apr-07 9:12 
GeneralRe: pinvoke COM function and damaged memory Pin
Judah Gabriel Himango16-Apr-07 9:50
sponsorJudah Gabriel Himango16-Apr-07 9:50 
GeneralRe: pinvoke COM function and damaged memory Pin
led mike16-Apr-07 10:50
led mike16-Apr-07 10:50 
AnswerRe: pinvoke COM function and damaged memory Pin
Judah Gabriel Himango16-Apr-07 9:43
sponsorJudah Gabriel Himango16-Apr-07 9:43 
GeneralRe: pinvoke COM function and damaged memory [modified] Pin
realmontanakid16-Apr-07 10:05
realmontanakid16-Apr-07 10:05 
GeneralRe: pinvoke COM function and damaged memory Pin
Luc Pattyn16-Apr-07 11:52
sitebuilderLuc Pattyn16-Apr-07 11:52 
GeneralRe: pinvoke COM function and damaged memory Pin
realmontanakid16-Apr-07 12:08
realmontanakid16-Apr-07 12:08 
GeneralRe: pinvoke COM function and damaged memory Pin
Luc Pattyn16-Apr-07 13:27
sitebuilderLuc Pattyn16-Apr-07 13:27 
GeneralRe: pinvoke COM function and damaged memory Pin
Luc Pattyn16-Apr-07 13:38
sitebuilderLuc Pattyn16-Apr-07 13:38 
QuestionDynamic enumeration Pin
kkadir16-Apr-07 8:34
kkadir16-Apr-07 8:34 
AnswerRe: Dynamic enumeration Pin
Judah Gabriel Himango16-Apr-07 9:46
sponsorJudah Gabriel Himango16-Apr-07 9:46 
GeneralRe: Dynamic enumeration Pin
kkadir16-Apr-07 10:42
kkadir16-Apr-07 10:42 
GeneralRe: Dynamic enumeration Pin
Judah Gabriel Himango17-Apr-07 4:57
sponsorJudah Gabriel Himango17-Apr-07 4:57 
AnswerRe: Dynamic enumeration Pin
pbraun16-Apr-07 13:13
pbraun16-Apr-07 13:13 
QuestionHow can i change values in a program's memory? Pin
sharpiesharpie16-Apr-07 8:11
sharpiesharpie16-Apr-07 8:11 
AnswerRe: How can i change values in a program's memory? Pin
Judah Gabriel Himango16-Apr-07 9:48
sponsorJudah Gabriel Himango16-Apr-07 9:48 
GeneralRe: How can i change values in a program's memory? Pin
sharpiesharpie16-Apr-07 9:53
sharpiesharpie16-Apr-07 9:53 

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.