|
Hello,
I wrote a Windows-Application (not a console applic.)
If I start it in a Console (DOS-Windows in Win98/NT),
so I can give commandlines for example:
"mywinprog.exe var1 var2 var3", it's works fine.
So I can start the winprog with a batchfile ( example.bat in a console ).And for any result, I send ReturnValues from "mywinprog.exe" .
My Problem:
I want to write a String/Text into this console, where I start the mywinprog.exe.
How can I do this ???
The API Funct. is : WriteConsole(handle, text, strlen (txt),0,0), but if I use the GetStdHandle(STD_OUTPUT_HANDLE), I receive value NULL.
With API FindWindowEx(..), I could'nt find the console.
|
|
|
|
|
Hi,
I have a table in MS Access that has Date(short Date) and Time(short Time) fields. I have a CRecordSet object that is to be mapped to the fields of that table.
My questions:
1. What should be data type of the variables in CRecordSet object, to be mapped to corresponding Date and Time fields in MSACCESS.
2. How to retrieve values from these variables. How to use them if they are COleVariant variables.
Help from any one will be appreciated.
Adnan.
|
|
|
|
|
Here's the scenario...
I've a VB project that uses COM objects & also opens an ADO database connection. When the app is shutdown, it just hangs... if i try attaching the debugger to the process, i get the dreaded "DM0025 - Error attaching to process" msg taking down the process that i want to debug
What is also strange about the behavior is that if i dont open an ADO database connection, then the app shutsdown cleanly. I've to mention that the COM object also connects internally to an Oracle database.
How do you go about debugging this behavior?
Any pointers would be appreciated. TIA
Chen Venkataraman
|
|
|
|
|
1. try to attach before shutdown
2. check that you have admin permissions
3. do not use Oracle
|
|
|
|
|
Hey, I posted this before wondering how I could shut down an external program. I am trying to shutdown kazaa and I learned that all I had to do was send the WM_CLOSE command to it.
Now, this would work on most normal programs but Kazaa is in the system tray so instead of closing Kazaa it just "minimizes" it into the tray. If I send the message a second time then it maximizes again. How can I shut it down completely? Thanks for any help.
|
|
|
|
|
Use Spy++ to find out the ID of the message that Kazaa uses to close when you select the close function from the right click menu when it is minimized to system tray.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Wow, never heard of Spy++ before but thats a great tool. Anyway I found the messages to be WM_DESTROY and then it also called WM_NCDESTROY. Now I have the button call these messages when its pressed but it says that "Kazaalite has performed an illegal operation." The program closes fine but is there anyway I can shut it down without this happening?
|
|
|
|
|
WM_DESTROY and WM_NCDESTROY are messages sent by Windows when it is closing a Window. They aren't messages you can send to a window to make it close.
Instead, try sending a WM_SYSCOMMAND message, with wParam=SC_CLOSE and lParam=0 . This tells the application to close the window.
Software Zen: delete this;
|
|
|
|
|
When I do that it says "Debug Assertion Failed" in EXPLORER.EXE.
|
|
|
|
|
::TerminateProcess() is probably more adequate for this kind of program.
|
|
|
|
|
When you are calling an ActiveX DLL in a VC++ app and you declare a pointer to the SAFEARRAY, how do you reference the actually array data that is being passed back in the function call.
|
|
|
|
|
Explain yourself better and I might be able to help.
|
|
|
|
|
Hi,
Got your email. So you are trying to access the raw array data in C++?
a couple of q's:
> CtGetDigitalOutput128 is being called by C++, not VB, right? (VB can't easily use raw array data.)
> What error/problem do you have when trying to do this, and where?
|
|
|
|
|
Howdy'
I need to resize a CButton according to the text I'm placing in it, when the button is created.
Is there a thing I can do that is easier than doing a DT_CALCRECT on the text(or something like that), and resizing the button to fit ?
Thanks.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I want to interrupt:
ReadFile(((Messgeraete*)lparam)->h_com, &inbuffer1, 13, &nBytesRead1, NULL);
I've used ReadFile without timeout.
Interruption should be done from another Thread.
Does anybody no an order which kills the "ReadFile".
Thanks
Heiko
|
|
|
|
|
I solve this problem by reading a little bit of the file at a time ( usually 2K, 4K or 8K) then checking to see if I should try to read more. If your are going to use threads use a kill event as your check.
John
|
|
|
|
|
Sorry, for not mention it
I don't want to read from a File. I want to read two times 13bytes for com1;
the 13th ist an carriage return.
You say I should use a kill Event, but I don't know which Event I should take.
Can you give me an example.
Here is a part of my programcode:
h_com = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
...settings of dcbs and COMMTIMEOUTS
ReadFile(((Messgeraete*)lparam)->h_com, &inbuffer1, 13, &nBytesRead1, NULL);
ReadFile(((Messgeraete*)lparam)->h_com, &inbuffer2, 13, &nBytesRead2, NULL);
Now I need the command (which I want to use in my Thread) to kill the ReadFile
Thanks
Heiko
|
|
|
|
|
Thanks for the info, now that I see what you mean I am not sure how to do this.
John
|
|
|
|
|
Solution was to kill the whole thread which contains the command readfile
|
|
|
|
|
Use ReadFile asynchronously by defining overlapped structure.
Use GetOverlappedResult for waiting for reading completion or for your stop event.
Don't forget to use OpenFile with the flag FILE_FLAG_OVERLAPPED.
|
|
|
|
|
I created a control which is CWnd derived and nested it in an SDI application
with a CSplitterWnd derived class ( 2 columns, the Ctrl is in the left one, a CView is in the right one, no custom Paint operation ).
The Ctrl uses FillSolidRect via a MemoryDC an OnEraseBkgrnd() returns FALSE.
When I resize the ParentFrame, the Ctrl, the StatusBar and the Toolbar are extremely flickering.
I tried overriding CSplitterWnd::OnEraseBkgrnd() but it kept flickering, nontheless.
Has anyone an idea, what I can do about this issue?
Thanks
|
|
|
|
|
You should prevent window from being redrawn at the beginning of the sizing and at the end you should restart the redrawing...
take a look at msdn the article:
Tip 63: Preventing List Box from Redrawing (Refreshing)
it talks about WM_SETREDRAW...
hope this helps...
|
|
|
|
|
Overriding CSplitterWnd::OnEraseBkgrnd() should solve the problem.
It should look like this:
BOOL CSplitterWnd::OnEraseBkgrnd()
{
return TRUE;
}
|
|
|
|
|
I already did that, but it still flickers the hell out of the screen.
But thanks for the reply.
|
|
|
|
|
How do I pass this structure i.e
struct s_test
{
char Name[15];
}test[10];
to a function??
Thanks,
grahamoj.
|
|
|
|