Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sending email Pin
louthy16-Apr-06 10:35
louthy16-Apr-06 10:35 
AnswerRe: Sending email Pin
MSNFans16-Apr-06 21:19
MSNFans16-Apr-06 21:19 
QuestionAbout WMI on C# Pin
The_Rank16-Apr-06 6:59
The_Rank16-Apr-06 6:59 
AnswerRe: About WMI on C# Pin
Le Thanh Cong16-Apr-06 23:06
Le Thanh Cong16-Apr-06 23:06 
QuestionProblem with method signatures Pin
t4ure4n16-Apr-06 6:46
t4ure4n16-Apr-06 6:46 
AnswerRe: Problem with method signatures Pin
Judah Gabriel Himango16-Apr-06 11:21
sponsorJudah Gabriel Himango16-Apr-06 11:21 
AnswerRe: Problem with method signatures Pin
Michael Dunn16-Apr-06 12:01
sitebuilderMichael Dunn16-Apr-06 12:01 
QuestionRe: Problem with method signatures Pin
t4ure4n26-Apr-06 4:34
t4ure4n26-Apr-06 4:34 
I a calling an API method which requires passing the reference to an array as parameter. The problem is with that parameter

The actual function is
BOOL __stdcall G3BlockScan(int hRadio,DWORD *Freqs, int Count,int StopSquelchRaw, DWORD FeedbackTime,HWND WinHandle,DWORD Msg);

Here Freqs is an array whose contents are mofied by the The API function call.

I have wrapped this function in C# as follows..

[DllImport("wrg303api.dll")] <br />
public static extern bool G3BlockScan(int hRadio, <big>uint [] Freqs</big>, int Count,int StopSquelchRaw,uint FeedbackTime,IntPtr WinHandle,uint Msg);
and the function call is like this .....
..... some code.....<br />
uint[] Freqs = new uint[1001]; // buffer for frequencies to scan<br />
..... some code....<br />
if (!clsApiWrapper.G3BlockScan(radioHandle, <big>Freqs</big>, 1001, 256, 100000, pointer,Msg))<br />
MessageBox.Show("The block scanning failed to start", "WiNRADiO - Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); <br />
..... some code ....
But now when I run the app it doesn't change the contents of the array. so I believe I need to pass the reference of the array to the function. And if I change the code like this to pass the reference of the array

[DllImport("wrg303api.dll")] <br />
public static extern bool G3BlockScan(int hRadio, <big>ref uint [] Freqs</big>, int Count,int StopSquelchRaw,uint FeedbackTime,IntPtr WinHandle,uint Msg);<br />
<br />
..... some code.....<br />
uint[] Freqs = new uint[1001]; // buffer for frequencies to scan<br />
..... some code....<br />
if (!clsApiWrapper.G3BlockScan(radioHandle,<big>ref Freqs</big>, 1001, 256, 100000, pointer,Msg))<br />
MessageBox.Show("The block scanning failed to start", "WiNRADiO - Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);


Now when I access the Freqs array after the method call I encounter a strange behaviour.. The size of Freqs array is reduced from 1000 to 1.
I can't figure out what is going wrong.

Can any1 plz suggest what to do.


o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
QuestionEmbedding executable in my application Pin
zorro.tmh16-Apr-06 3:08
zorro.tmh16-Apr-06 3:08 
AnswerRe: Embedding executable in my application Pin
Judah Gabriel Himango16-Apr-06 6:01
sponsorJudah Gabriel Himango16-Apr-06 6:01 
GeneralRe: Embedding executable in my application Pin
zorro.tmh16-Apr-06 23:36
zorro.tmh16-Apr-06 23:36 
QuestionHow can I use the objects which I made by 3DMax into Open GL ??!! Pin
suroor45316-Apr-06 2:27
suroor45316-Apr-06 2:27 
AnswerRe: How can I use the objects which I made by 3DMax into Open GL ??!! Pin
Judah Gabriel Himango16-Apr-06 6:09
sponsorJudah Gabriel Himango16-Apr-06 6:09 
GeneralRe: How can I use the objects which I made by 3DMax into Open GL ??!! Pin
suroor45316-Apr-06 7:26
suroor45316-Apr-06 7:26 
GeneralRe: How can I use the objects which I made by 3DMax into Open GL ??!! Pin
Judah Gabriel Himango16-Apr-06 15:41
sponsorJudah Gabriel Himango16-Apr-06 15:41 
AnswerRe: How can I use the objects which I made by 3DMax into Open GL ??!! Pin
Judah Gabriel Himango16-Apr-06 6:25
sponsorJudah Gabriel Himango16-Apr-06 6:25 
QuestionList with ListChanged and ListChanging events - asking for code review and suggestions (long source code included) Pin
Patrick Klug16-Apr-06 2:20
Patrick Klug16-Apr-06 2:20 
AnswerRe: List with ListChanged and ListChanging events - asking for code review and suggestions (long source code included) Pin
Guffa16-Apr-06 3:45
Guffa16-Apr-06 3:45 
GeneralRe: List with ListChanged and ListChanging events - asking for code review and suggestions (long source code included) Pin
Patrick Klug16-Apr-06 6:10
Patrick Klug16-Apr-06 6:10 
QuestionTreeView Pin
babamara16-Apr-06 2:05
babamara16-Apr-06 2:05 
AnswerRe: TreeView Pin
Judah Gabriel Himango16-Apr-06 6:15
sponsorJudah Gabriel Himango16-Apr-06 6:15 
Questionhow to set Password on Access database ? Pin
hdv21216-Apr-06 1:55
hdv21216-Apr-06 1:55 
GeneralRe: how to set Password on Access database ? Pin
Guffa16-Apr-06 2:16
Guffa16-Apr-06 2:16 
GeneralRe: how to set Password on Access database ? Pin
hdv21216-Apr-06 3:42
hdv21216-Apr-06 3:42 
QuestionHow to receive result of sending the letter in MS Outlook? Pin
Vasya - dragon16-Apr-06 0:47
Vasya - dragon16-Apr-06 0: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.