Click here to Skip to main content
15,926,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: Equivalent of IFrame Pin
JohnBond31113-Oct-06 10:04
JohnBond31113-Oct-06 10:04 
GeneralRe: Equivalent of IFrame Pin
Dan Neely13-Oct-06 10:36
Dan Neely13-Oct-06 10:36 
QuestionCreating virtual partitions in C# Pin
bunnyEATINGrabbit13-Oct-06 6:01
bunnyEATINGrabbit13-Oct-06 6:01 
AnswerRe: Creating virtual partitions in C# Pin
Daniel Grunwald13-Oct-06 7:12
Daniel Grunwald13-Oct-06 7:12 
QuestionRe: Creating virtual partitions in C# Pin
bunnyEATINGrabbit13-Oct-06 12:54
bunnyEATINGrabbit13-Oct-06 12:54 
AnswerRe: Creating virtual partitions in C# Pin
mav.northwind13-Oct-06 22:16
mav.northwind13-Oct-06 22:16 
AnswerRe: Creating virtual partitions in C# Pin
Daniel Grunwald13-Oct-06 22:22
Daniel Grunwald13-Oct-06 22:22 
QuestionWhat do I have to do ?? Pin
pirate91113-Oct-06 5:45
pirate91113-Oct-06 5:45 
AnswerRe: What do I have to do ?? Pin
Judah Gabriel Himango13-Oct-06 6:30
sponsorJudah Gabriel Himango13-Oct-06 6:30 
GeneralRe: What do I have to do ?? Pin
pirate91113-Oct-06 18:22
pirate91113-Oct-06 18:22 
AnswerRe: What do I have to do ?? Pin
Amar Chaudhary13-Oct-06 6:51
Amar Chaudhary13-Oct-06 6:51 
Questionsocket programing [modified] Pin
Airtel_nokia13-Oct-06 5:10
Airtel_nokia13-Oct-06 5:10 
AnswerRe: socket programing Pin
Judah Gabriel Himango13-Oct-06 6:31
sponsorJudah Gabriel Himango13-Oct-06 6:31 
GeneralRe: socket programing Pin
Airtel_nokia13-Oct-06 21:15
Airtel_nokia13-Oct-06 21:15 
GeneralRe: socket programing Pin
Airtel_nokia15-Oct-06 8:47
Airtel_nokia15-Oct-06 8:47 
GeneralRe: socket programing Pin
Judah Gabriel Himango15-Oct-06 10:38
sponsorJudah Gabriel Himango15-Oct-06 10:38 
QuestionUserControl event handling Pin
CoolASL13-Oct-06 5:01
CoolASL13-Oct-06 5:01 
AnswerRe: UserControl event handling Pin
Dave Kreskowiak13-Oct-06 7:00
mveDave Kreskowiak13-Oct-06 7:00 
AnswerRe: UserControl event handling Pin
Nader Elshehabi13-Oct-06 11:47
Nader Elshehabi13-Oct-06 11:47 
QuestionProblem using legacy C++ dll with C# Pin
JohnnyB71713-Oct-06 4:49
JohnnyB71713-Oct-06 4:49 
AnswerRe: Problem using legacy C++ dll with C# Pin
led mike13-Oct-06 7:58
led mike13-Oct-06 7:58 
GeneralRe: Problem using legacy C++ dll with C# Pin
JohnnyB71713-Oct-06 8:23
JohnnyB71713-Oct-06 8:23 
AnswerRe: Problem using legacy C++ dll with C# Pin
Nader Elshehabi13-Oct-06 11:43
Nader Elshehabi13-Oct-06 11:43 
Hello

I'm not sure if this is the problem, but if I were you I'd give these points attention in this particular order:

1- Your nDevice parameter is a DWORD which is 32bits long, while in your C# code you pass a long which is 64bits long. You should try passing an int32 instead.

2- The second parameter is char* while you pass it IntPtr.. I suggest you pass a StringBuilder class instead. If you do you'd have to remove the unsafe keyword.

3- You are making your C# declaration a bit complex. Why?? Try this P/Invoke:
[DllImport(@"C:\Documents and Settings\jbroderick\My Documents\Visual Studio 2005\Projects\\USB_D2XX_App\LogiComm2GD.dll",
ExactSpelling = true,
CharSet = CharSet.Auto,
CallingConvention = CallingConvention.Cdecl)]
public static extern bool ExGetDeviceSerialNumber(long nDevice, IntPtr ptr);

Notice that IMO the unsafe keyword is not necessary.

4- Calling another function from the exported function? I have doubts about this part.Try copy/paste the code in the second function into the first.

5- Comment these line for the sake of debugging, if they are not necessary:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
TRACE(_T("Entering LogiComm2GD ExGetDeviceSerialNumber\n"));

Also elaborate what does this macro do.

I hope this helps.

RegardsRose | [Rose]

GeneralRe: Problem using legacy C++ dll with C# Pin
JohnnyB71716-Oct-06 9:17
JohnnyB71716-Oct-06 9:17 
QuestionAdding a button (or other controls) to a form i have handle to Pin
ranzask13-Oct-06 3:34
ranzask13-Oct-06 3:34 

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.