Click here to Skip to main content
16,006,442 members
Home / Discussions / C#
   

C#

 
GeneralCollection Pin
Rassul Yunussov29-Jun-05 19:13
Rassul Yunussov29-Jun-05 19:13 
GeneralRe: Collection Pin
Christian Graus29-Jun-05 19:23
protectorChristian Graus29-Jun-05 19:23 
GeneralOleDbTransaction (rollback) Pin
myNameIsRon29-Jun-05 19:12
myNameIsRon29-Jun-05 19:12 
GeneralTrouble with marshalling structure Pin
Josh Lindenmuth29-Jun-05 18:42
Josh Lindenmuth29-Jun-05 18:42 
GeneralRe: Trouble with marshalling structure Pin
Bojan Rajkovic30-Jun-05 15:50
Bojan Rajkovic30-Jun-05 15:50 
Generalfunction template Pin
BicycleTheif29-Jun-05 17:55
BicycleTheif29-Jun-05 17:55 
GeneralRe: function template Pin
Christian Graus29-Jun-05 18:12
protectorChristian Graus29-Jun-05 18:12 
GeneralI have trouble with fgets function in C code Pin
dinh van hai29-Jun-05 17:20
dinh van hai29-Jun-05 17:20 
Hi,

In C# code I declared like this:

[DllImport("mydll.dll")]
public static extern int SearchString(out double x);

And I called the function:
double m_vo2Max=1;
SearchString(out m_vo2Max);


The SearchString function is on the mydll.dll. This dll is written in VC++ and the description is here:

#include "stdafx.h"
#include <stdio.h>


BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}


int WINAPI SearchString (double &X)
{
FILE *F;
char szString[255];
F= fopen("C:\\ParaLimit1.tbf", "rt");
fgets(szString, 255, F);
fclose(F);
return 1;
}

I always have an error : System.NullReferenceException
Additional Information : Object reference not set to an instance of an object.

I checked and found out that the error in the code below:
fgets(szString, 255, F);
Can you help me to solve this error.

Thank you,
GeneralRe: I have trouble with fgets function in C code Pin
Christian Graus29-Jun-05 18:14
protectorChristian Graus29-Jun-05 18:14 
GeneralRun another console application in my console application Pin
eggie529-Jun-05 13:08
eggie529-Jun-05 13:08 
GeneralRe: Run another console application in my console application Pin
Matt Gerrans29-Jun-05 14:37
Matt Gerrans29-Jun-05 14:37 
GeneralRe: Run another console application in my console application Pin
eggie530-Jun-05 6:51
eggie530-Jun-05 6:51 
GeneralRe: Run another console application in my console application Pin
leppie30-Jun-05 7:45
leppie30-Jun-05 7:45 
GeneralRe: Run another console application in my console application Pin
Matt Gerrans30-Jun-05 7:55
Matt Gerrans30-Jun-05 7:55 
GeneralFullRowSelect in DataGrid Pin
Jassim Rahma29-Jun-05 11:52
Jassim Rahma29-Jun-05 11:52 
GeneralRe: FullRowSelect in DataGrid Pin
Hugo Migneron30-Jun-05 3:09
Hugo Migneron30-Jun-05 3:09 
GeneralHeader information in UDP Packet Pin
Hugo Migneron29-Jun-05 9:36
Hugo Migneron29-Jun-05 9:36 
Generalrunning g++ using process.start Pin
thepersonof29-Jun-05 8:31
thepersonof29-Jun-05 8:31 
GeneralRe: running g++ using process.start Pin
Judah Gabriel Himango29-Jun-05 8:44
sponsorJudah Gabriel Himango29-Jun-05 8:44 
GeneralRe: running g++ using process.start Pin
S. Senthil Kumar29-Jun-05 9:02
S. Senthil Kumar29-Jun-05 9:02 
GeneralRe: running g++ using process.start Pin
S. Senthil Kumar29-Jun-05 9:01
S. Senthil Kumar29-Jun-05 9:01 
GeneralRe: running g++ using process.start Pin
thepersonof29-Jun-05 9:54
thepersonof29-Jun-05 9:54 
GeneralRe: running g++ using process.start Pin
S. Senthil Kumar29-Jun-05 11:45
S. Senthil Kumar29-Jun-05 11:45 
GeneralRe: running g++ using process.start Pin
Matt Gerrans29-Jun-05 14:41
Matt Gerrans29-Jun-05 14:41 
GeneralRe: running g++ using process.start Pin
Matt Gerrans29-Jun-05 14:42
Matt Gerrans29-Jun-05 14:42 

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.