Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
QuestionRe: ObjectDataSource ID Pin
RepliCrux14-Jun-07 19:10
RepliCrux14-Jun-07 19:10 
AnswerRe: ObjectDataSource ID Pin
Expert Coming14-Jun-07 19:13
Expert Coming14-Jun-07 19:13 
QuestionAutoSave change in databound comboBox Pin
Glen Harvy14-Jun-07 17:31
Glen Harvy14-Jun-07 17:31 
GeneralRe: AutoSave change in databound comboBox Pin
Martin#14-Jun-07 21:37
Martin#14-Jun-07 21:37 
Questionspecial characters are coming in XML output Pin
saymajum14-Jun-07 17:14
saymajum14-Jun-07 17:14 
AnswerRe: special characters are coming in XML output Pin
Christian Graus14-Jun-07 17:31
protectorChristian Graus14-Jun-07 17:31 
GeneralRe: special characters are coming in XML output Pin
saymajum14-Jun-07 19:24
saymajum14-Jun-07 19:24 
QuestionA qustion on Dll Call Pin
Xiaoming Qian14-Jun-07 15:16
Xiaoming Qian14-Jun-07 15:16 
Hi everybody.I have problems when calling dll.
Here is the Dll function definition(from the vander's document):
<br />
__int16 __stdcall MW_GetDBRecord(HANDLE icdev, __int16 fsid,<br />
      __int16 rec_size, char *buf, int *rlen)<br />
Input parameters: 	<br />
icdev:		device handle <br />
fsid:			selected table NO. <br />
rec_size:		a record size space.<br />
Output parameters :<br />
Buf: 		return entire record data (you need give buf enough space );<br />
Rlen:		length of data .<br />

And here is my code:
<br />
[DllImport("mwhandset")]<br />
public static extern Int16 MW_GetDBRecord(IntPtr icdev,Int16 fsid,<br />
      Int16 rec_size,ref string buff,ref int rlen);<br />
<br />
...<br />
<br />
private void button3_Click(object sender, System.EventArgs e)<br />
{<br />
  ...<br />
  int rlen = 0;<br />
  string buff;<br />
  buff = "                                       ";//the length is enough<br />
  MW_GetDBRecord(m_icdev,0,16,buff,ref rlen);<br />
}<br />
<br />


When calling MW_GetDBRecord it raise "System.NullReferenceException: Object not set to an instance".I'm sure the function has completed on the device,

because rlen=16(the record size) when the exception raised.So I think it is caused by type incompatibility,most likely the buff parameter.What type should I

use corresponding to "char *buf"? Or it is caused by any other reason?
Can anyone help me? Any idea will be appropriate.
AnswerRe: A qustion on Dll Call Pin
Tarakeshwar Reddy14-Jun-07 17:03
professionalTarakeshwar Reddy14-Jun-07 17:03 
GeneralRe: A qustion on Dll Call Pin
Xiaoming Qian14-Jun-07 20:41
Xiaoming Qian14-Jun-07 20:41 
Questionhow to put a Button Image into an array? Pin
Khoramdin14-Jun-07 14:38
Khoramdin14-Jun-07 14:38 
AnswerRe: how to put a Button Image into an array? Pin
alexey N14-Jun-07 18:44
alexey N14-Jun-07 18:44 
QuestionConvert Large Icons into Small???? Pin
classNoob14-Jun-07 13:29
classNoob14-Jun-07 13:29 
QuestionUsing your own classes in methods. Pin
jblouir14-Jun-07 12:32
jblouir14-Jun-07 12:32 
AnswerRe: Using your own classes in methods. Pin
Guffa14-Jun-07 12:55
Guffa14-Jun-07 12:55 
GeneralRe: Using your own classes in methods. Pin
jblouir14-Jun-07 13:05
jblouir14-Jun-07 13:05 
GeneralRe: Using your own classes in methods. Pin
jblouir14-Jun-07 13:26
jblouir14-Jun-07 13:26 
GeneralWell... Pin
jblouir14-Jun-07 13:31
jblouir14-Jun-07 13:31 
GeneralRe: Well... Pin
jblouir14-Jun-07 13:37
jblouir14-Jun-07 13:37 
GeneralRe: Well... Pin
jblouir14-Jun-07 13:47
jblouir14-Jun-07 13:47 
GeneralRe: Well... Pin
Christian Graus14-Jun-07 13:52
protectorChristian Graus14-Jun-07 13:52 
AnswerRe: Using your own classes in methods. Pin
Guffa14-Jun-07 13:30
Guffa14-Jun-07 13:30 
GeneralRe: Using your own classes in methods. Pin
Rudolf Jan15-Jun-07 0:27
Rudolf Jan15-Jun-07 0:27 
Questionmulti list problem [modified] Pin
bolhassanim@bellsouth.net14-Jun-07 10:34
professionalbolhassanim@bellsouth.net14-Jun-07 10:34 
AnswerRe: multi list problem Pin
Christian Graus14-Jun-07 11:47
protectorChristian Graus14-Jun-07 11:47 

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.