Click here to Skip to main content
16,007,885 members
Home / Discussions / C#
   

C#

 
GeneralRe: Distribute my software to other computers Pin
User 665813-Aug-05 1:39
User 665813-Aug-05 1:39 
GeneralRe: Distribute my software to other computers Pin
Ming Luo13-Aug-05 5:22
Ming Luo13-Aug-05 5:22 
GeneralRe: Distribute my software to other computers Pin
User 665813-Aug-05 7:50
User 665813-Aug-05 7:50 
Generalproblem with asynchronous server Pin
bahith13-Aug-05 0:40
bahith13-Aug-05 0:40 
GeneralRe: problem with asynchronous server Pin
Vasudevan Deepak Kumar14-Aug-05 1:55
Vasudevan Deepak Kumar14-Aug-05 1:55 
GeneralRe: problem with asynchronous server Pin
S. Senthil Kumar14-Aug-05 3:31
S. Senthil Kumar14-Aug-05 3:31 
GeneralDatetimePicker in a datagrid Pin
deep712-Aug-05 21:36
deep712-Aug-05 21:36 
GeneralUnmanaged dll access from c# passing paramaters by reference Pin
steveski7412-Aug-05 21:13
steveski7412-Aug-05 21:13 
Hi,

I'm having some problems with DLLImport'ing into an application.

I have a .dll which has no com interface and requires importing of each function I wish to use.
These DLLImport lines sit in a class name VeryWrap
It's a PDF toolkit, and I'm able to create a pdf fine without any content with:

[DllImport("verywrite.dll", EntryPoint="VeryCreate", ExactSpelling=false,CallingConvention=CallingConvention.Cdecl)]<br />
public static extern long pVeryCreate(char[] filename);


Then I run this with:
long id = veryWrap.VeryCreate("Test1.pdf");

I get a file names Test1.pdf, great! I know the technique works.
But what I need is to insert an image into this file.
The library provides a function that takes an image filename and returns the width and height of the image which I then use to create the correct pdf page size I need.
But the return value of the function is a long stating success or failure of the function call.
The width and height are by as paramaters by reference to the function. These values aren't being written to.
The filename as defined in the original C function prototypes are char *, so I thought I should do 'char[] filename'. It seems to work for the Create function.

Now Here's my declaration for the Get Function:
[DllImport("verywrite.dll",EntryPoint="VeryGetFunction",ExactSpelling=false,CallingConvention=CallingConvention.Cdecl)]<br />
public static extern long pVeryGetFunction_ByRef(long id,long func_code,ref long para1,ref long para2,char[] para3,char[] para4);


para1 and para2 are the parameters in which I use my width and height variables, and para3 is the filename.
My call to this function is:
ret = pVeryGetFunction_ByRef(id, func_code, ref width, ref height, filename.ToCharArray(), filename.ToCharArray());


The value of width and height do not change but they should be the width and height of the image (filename).

Does anyone have any idea if I'm missing something?


Thanks,

Steve
Generalwrapping Dlls into .exe Pin
allenmpcx12-Aug-05 19:08
allenmpcx12-Aug-05 19:08 
GeneralRe: wrapping Dlls into .exe Pin
S. Senthil Kumar12-Aug-05 19:53
S. Senthil Kumar12-Aug-05 19:53 
GeneralRe: wrapping Dlls into .exe Pin
allenmpcx12-Aug-05 19:56
allenmpcx12-Aug-05 19:56 
GeneralRe: wrapping Dlls into .exe Pin
mav.northwind12-Aug-05 21:53
mav.northwind12-Aug-05 21:53 
GeneralRe: wrapping Dlls into .exe Pin
allenmpcx12-Aug-05 21:56
allenmpcx12-Aug-05 21:56 
GeneralRe: wrapping Dlls into .exe Pin
mav.northwind13-Aug-05 7:12
mav.northwind13-Aug-05 7:12 
GeneralRe: wrapping Dlls into .exe Pin
allenmpcx13-Aug-05 8:21
allenmpcx13-Aug-05 8:21 
GeneralRe: wrapping Dlls into .exe Pin
DavidNohejl13-Aug-05 3:39
DavidNohejl13-Aug-05 3:39 
GeneralRe: wrapping Dlls into .exe Pin
MrEyes13-Aug-05 10:02
MrEyes13-Aug-05 10:02 
GeneralRe: wrapping Dlls into .exe Pin
allenmpcx13-Aug-05 10:06
allenmpcx13-Aug-05 10:06 
GeneralRe: wrapping Dlls into .exe Pin
Vasudevan Deepak Kumar14-Aug-05 2:39
Vasudevan Deepak Kumar14-Aug-05 2:39 
GeneralRe: wrapping Dlls into .exe Pin
Joel Lucsy16-Aug-05 4:34
Joel Lucsy16-Aug-05 4:34 
GeneralRead an INI Pin
Anonymous12-Aug-05 14:48
Anonymous12-Aug-05 14:48 
GeneralRe: Read an INI Pin
S. Senthil Kumar12-Aug-05 19:54
S. Senthil Kumar12-Aug-05 19:54 
GeneralRe: Read an INI Pin
Matt Gerrans13-Aug-05 7:12
Matt Gerrans13-Aug-05 7:12 
GeneralRe: Read an INI Pin
S. Senthil Kumar14-Aug-05 3:40
S. Senthil Kumar14-Aug-05 3:40 
GeneralRe: Read an INI Pin
MrEyes13-Aug-05 10:10
MrEyes13-Aug-05 10:10 

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.