Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
AnswerRe: TreeView SelectedNode[0] Pin
RaviRanjanKr16-Jan-11 2:28
professionalRaviRanjanKr16-Jan-11 2:28 
GeneralRe: TreeView SelectedNode[0] Pin
S078416-Jan-11 19:53
S078416-Jan-11 19:53 
QuestionC# How to get row value of DataGridView Pin
LAPEC13-Jan-11 12:46
LAPEC13-Jan-11 12:46 
AnswerRe: C# How to get row value of DataGridView Pin
Dalek Dave13-Jan-11 13:05
professionalDalek Dave13-Jan-11 13:05 
AnswerRe: C# How to get row value of DataGridView Pin
Luc 64801113-Jan-11 15:10
Luc 64801113-Jan-11 15:10 
AnswerRe: C# How to get row value of DataGridView Pin
Luc 64801113-Jan-11 15:14
Luc 64801113-Jan-11 15:14 
AnswerRe: C# How to get row value of DataGridView Pin
Dalek Dave13-Jan-11 15:33
professionalDalek Dave13-Jan-11 15:33 
AnswerRe: C# How to get row value of DataGridView Pin
Luc Pattyn13-Jan-11 15:50
sitebuilderLuc Pattyn13-Jan-11 15:50 
QuestionMost efficient Collection? Pin
kinar13-Jan-11 10:41
kinar13-Jan-11 10:41 
AnswerRe: Most efficient Collection? PinPopular
dan!sh 13-Jan-11 11:20
professional dan!sh 13-Jan-11 11:20 
AnswerRe: Most efficient Collection? Pin
Luc Pattyn13-Jan-11 11:28
sitebuilderLuc Pattyn13-Jan-11 11:28 
AnswerRe: Most efficient Collection? Pin
Ray Cassick13-Jan-11 11:54
Ray Cassick13-Jan-11 11:54 
AnswerRe: Most efficient Collection? Pin
SledgeHammer0113-Jan-11 13:00
SledgeHammer0113-Jan-11 13:00 
AnswerRe: Most efficient Collection? Pin
Dalek Dave13-Jan-11 13:08
professionalDalek Dave13-Jan-11 13:08 
GeneralOT [ sufficiently remedied for now ] Pin
Luc Pattyn13-Jan-11 13:15
sitebuilderLuc Pattyn13-Jan-11 13:15 
GeneralRe: Most efficient Collection? Pin
Dalek Dave13-Jan-11 13:18
professionalDalek Dave13-Jan-11 13:18 
GeneralRe: Most efficient Collection? Pin
Luc Pattyn13-Jan-11 13:23
sitebuilderLuc Pattyn13-Jan-11 13:23 
AnswerRe: Most efficient Collection? Pin
jschell14-Jan-11 10:09
jschell14-Jan-11 10:09 
QuestionHaving trouble writing to an excel file Pin
turbosupramk313-Jan-11 9:40
turbosupramk313-Jan-11 9:40 
AnswerRe: Having trouble writing to an excel file Pin
Dalek Dave13-Jan-11 10:31
professionalDalek Dave13-Jan-11 10:31 
QuestionDuplicate media player winodw Pin
polycom12313-Jan-11 8:25
polycom12313-Jan-11 8:25 
QuestionHow Do I get IME to open my custom IME UI Windows in C# [modified] Pin
greg ofiesh13-Jan-11 7:48
greg ofiesh13-Jan-11 7:48 
QuestionCalling C++ Image API from C# Pin
econner13-Jan-11 4:59
econner13-Jan-11 4:59 
AnswerRe: Calling C++ Image API from C# Pin
_Erik_13-Jan-11 5:16
_Erik_13-Jan-11 5:16 
GeneralRe: Calling C++ Image API from C# Pin
econner13-Jan-11 6:00
econner13-Jan-11 6:00 
Hi Erik, thanks for the suggestion. Below are the changes I have made. However, I am still receiving memory errors.

[StructLayout(LayoutKind.Sequential)]
public class MY_IMAGE
{

  public int width; // image width
  public int height; // image height
  public int info; // bit-count (1,4,8 bit)
  public IntPtr pbuf; // image buffer
}

[DllImport("scandll.dll")]
private extern static int WScanSelectBuf(MY_IMAGE image_down, MY_IMAGE image_up, int select);

public static int ScanSelectBuf(ref MY_IMAGE image_down, ref MY_IMAGE image_up, int select)
{  
  return WScanSelectBuf(image_down, image_up, select);
}


And also

public static int ScanSelectBuf(MY_IMAGE image_down, MY_IMAGE image_up, int select)
{  
  return WScanSelectBuf(image_down, image_up, select);
}


The API does not provide any other way to fill the MY_IMAGE struct other than calling:

private extern static int WScanSelectBuf(MY_IMAGE image_down, MY_IMAGE image_up, int select);

So, I do not have acces to fill the buffer with a byte[]. This should be happening from caling the method.

Erik - Is there anything I missed? If so, do you have an example?

Luc - Would you be able to provide an example of what you were referring to?

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.