Click here to Skip to main content
15,887,875 members
Home / Discussions / C#
   

C#

 
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?
GeneralRe: Calling C++ Image API from C# Pin
_Erik_13-Jan-11 6:10
_Erik_13-Jan-11 6:10 
GeneralRe: Calling C++ Image API from C# Pin
econner13-Jan-11 6:16
econner13-Jan-11 6:16 
GeneralRe: Calling C++ Image API from C# Pin
_Erik_13-Jan-11 6:47
_Erik_13-Jan-11 6:47 
GeneralRe: Calling C++ Image API from C# Pin
econner13-Jan-11 6:49
econner13-Jan-11 6:49 
GeneralRe: Calling C++ Image API from C# Pin
_Erik_13-Jan-11 6:55
_Erik_13-Jan-11 6:55 
GeneralRe: Calling C++ Image API from C# Pin
econner13-Jan-11 13:38
econner13-Jan-11 13:38 
GeneralRe: Calling C++ Image API from C# Pin
_Erik_14-Jan-11 1:51
_Erik_14-Jan-11 1:51 
GeneralRe: Calling C++ Image API from C# Pin
econner14-Jan-11 9:12
econner14-Jan-11 9:12 
GeneralRe: Calling C++ Image API from C# Pin
_Erik_14-Jan-11 10:22
_Erik_14-Jan-11 10:22 
GeneralRe: Calling C++ Image API from C# Pin
econner14-Jan-11 11:38
econner14-Jan-11 11:38 
GeneralRe: Calling C++ Image API from C# Pin
econner14-Jan-11 12:07
econner14-Jan-11 12:07 
GeneralRe: Calling C++ Image API from C# Pin
econner14-Jan-11 12:30
econner14-Jan-11 12:30 
GeneralRe: Calling C++ Image API from C# Pin
econner15-Jan-11 5:16
econner15-Jan-11 5:16 
GeneralRe: Calling C++ Image API from C# Pin
_Erik_17-Jan-11 2:32
_Erik_17-Jan-11 2:32 
AnswerRe: Calling C++ Image API from C# Pin
Luc Pattyn13-Jan-11 5:18
sitebuilderLuc Pattyn13-Jan-11 5:18 
AnswerRe: Calling C++ Image API from C# [modified] Pin
econner13-Jan-11 6:11
econner13-Jan-11 6:11 
AnswerRe: Calling C++ Image API from C# Pin
Luc Pattyn13-Jan-11 6:22
sitebuilderLuc Pattyn13-Jan-11 6:22 

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.