|
How is the function you're calling declared?
[modified]
I mean the function in the server.
What kind of argument are you supposed to pass, a VARIANT that contains a SafeArray?
[/modified]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi Roger,
Thanks for you reply ,
i have written a dll in C#.net and using RegAsm i created a .tlb file and i am using those functions in VC++6.0
C# function
void fun(byte[] input)
which is conveted to void fun(SAFEARRAY *input) in .tlb file .
now i dont know how to pass BYTE array to this fun function from VC++ 6.0
|
|
|
|
|
Ok, try the following:
- Create a SafeArray with a call to
::SafeArrayCreate() and set the VARTYPE parameter to VT_UI1 . - Get the data buffer of the SafeArray with a call to
::SafeArrayAccessData() and copy whatever data you'd like into the buffer. - Release the bufer when you're done with it with a call to
::SafeArrayUnaccessData() . - Call the
fun() function.
Look the SafeArray functions up for information on how to call and use them.
Begin at SafeArrayCreate[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger,
Thank you so much for your time to reply it.
|
|
|
|
|
|
0x0f is not a NULL (that is 0x00 ).
Why did you expect 'i' (it looks like your device sends binary data)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why are you opening the serial port twice ? You can read and write from the same CSerial instance. BTW, from where is this CSerial class coming from ?
|
|
|
|
|
Hello,
I want to make a very small application capable of screen capturing.
Plaese help me with some example.
Thanks & Regards.
Dhiraj
|
|
|
|
|
You could try something like this, don't know if this actually works or not, didn't try it, but it can be a starting point for you, good luck:
CDC ScreenDC;
ScreenDC.Attach(::GetDC(NULL));
CBitmap Capture;
CSize Dimensions(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
Capture.CreateCompatibleBitmap(&ScreenDC, Dimensions.cx, Dimensions.cy);
CDC MemDC;
MemDC.CreateCompatibleDC(&ScreenDC);
CBitmap *OldBitmap = MemDC.SelectObject(&Capture);
MemDC.BitBlt(0, 0, Dimensions.cx, Dimensions.cy, &ScreenDC, 0, 0, SRCCOPY);
MemDC.SelectObject(OldBitmap);
MemDC.DeleteDC();
::ReleaseDC(NULL, ScreenDC.Detach());
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
|
Actually you know the logic. Maybe you don't know the realtive API.
What are your doubts about? Are you able to open and read the file?
Are you able to open and write to the serial port?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am using a 3rd party library(.h and .lib file) in my project.
I create one win32 app It is running successfully. But whe I tried to same library with SDI app It is giving LNK 2019 linking error although I have add the library name in project settings.
This library have 4 function but linking errors is coming for only 2.
If I comment these 2 function, program succeed .
Could you tell me what might me the problem, I am using vc.net 2003
|
|
|
|
|
See, for instance, this [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi every one
i want copy data from memory.is it possible ?
there are many tools for dumping process from memory but i want dump data from memory.
for example i want dump Stream of one pdf or doc file from memory . is it possible?
plz introduce me tool or articles about it.
thanks a lot
|
|
|
|
|
Probably I haven't got you. Do you really indend to dump the file content?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All
I want to open a application through shortcut key which is runing in background.Can any one tell me how can i do this?Plz help me
modified on Thursday, November 27, 2008 1:12 AM
|
|
|
|
|
Are you intending to implement a key board hook...something similar to (Window's Key+d) that minimizes all the open windows and leads you to the desktop window
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Check second reply to this[^] post.
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
|
I am glad it helped
Regards,
Sandip.
|
|
|
|
|
I want when I click next button ,next window should'nt appear until all the processing against next button is completed.I used Sleep(1000).It is doing but Interface color get black as I press next button.What should I do?
|
|
|
|
|
You can use polling technique to determine if a task is complete, or use some event notification to let you know about the task completion.
Alternatively, you can use a boolean variable and set it to true once the task is completed and keep on monitoring the variable until its set to TRUE.
Putting Sleep() in code is not a good idea. there are other techniques too.
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
can you do something like this.. Disable Next Button and Display a progress bar showing that some work going on. once your work is complete show your next window!. sleeping with halt your main thread!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Possibly you have to use threads.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sleeping in GUI thread is not a good idea. Its recommended to avoid polling mechanism. But if situation demands it, then try using LockWindowUpdate() and UnlockWindowUpdate() . It might be helpful. Check the code snippet.
void CRabbitDlg::OnButton1()
{
LockWindowUpdate();
Sleep( 3000 );
UnlockWindowUpdate();
}
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|