|
Many Thanks !
I´ve done it this way:
DWORD dwLength = MAX_COMPUTERNAME_LENGTH + 1;
CString csComputerName;
GetComputerName( csComputerName.GetBuffer( 0), &dwLength);
|
|
|
|
|
Hi there,
The recurements of the program are: to make ellipse with LeftButton of the mouse and to move the same ellipse with RightButton. I have program witch make these things for octagon...but I cant transform it for ellipse....if anybody can help I'll post the octagon's code...please
|
|
|
|
|
roonex wrote: to make ellipse with LeftButton of the mouse and to move the same ellipse with RightButton. I have program witch make these things for octagon...but I cant transform it for ellipse....if anybody can help I'll post the octagon's code...please
what about :-
CDC::EllipseSee Also
CDC Overview | Class Members | Hierarchy Chart | CDC::Arc | CDC::Chord | Ellipse
Draws an ellipse.
BOOL Ellipse(
int x1,
int y1,
int x2,
int y2
);
BOOL Ellipse(
LPCRECT lpRect
);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow cheers, Alok Gupta VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello,
I have a problem in using threads.
There is a main thread, when a button is clicked a dll has to start executing.
This process takes some time, to a user it appears as if the system has crashed.
So I use thread to display a progress bar during the execution of the dll.
The problem is that, the progress bar does not get updated during the execution of the dll, the dll seems to block the thread.
(The dll is written by someone else so I have no access to the source code,
I know only the inputs and the expected output.)
The thread(worker) is implemented as a global function (UINT....)it also has
the highest priority.
Could anyone please help me.
Nami.
|
|
|
|
|
1. Simplify - you have mentioned 3 threads (main, progress box, worker) - simplify to two threads (main [run progress box here], worker)
2. If your worker has higher priority than the main thread, the main thread will not run unless the worker thread yields in some way - a WaitFor... or Sleep statement, etc. You will want the two threads to have the same base priority and then the main thread will have a slightly higher priority because it will have the focus but the worker thread will still be serviced.
HTH
Dan
|
|
|
|
|
Hello,
Thanks for your reply.
There are 2 threads in the application.
The first is the main thread and the second is a worker thread
which is used to draw the progress bar on the screen.
I have used
do
{
//draw the progress bar
}
while (::WaitForSingleObject(g_eKillTimerThreadProc.m_hObject, 0) != WAIT_OBJECT_0);
The main thread is used for the dll execution.
The problem is that the progress bar starts and stops in middle and reaches 100% only after the dll has been executed.
Thanks for your time.
Nami
-- modified at 4:48 Thursday 2nd February, 2006
|
|
|
|
|
A while ago I posted a question about an application that I have written with a MSFlexgrid control. When I copy the app to my target machine, I find it wont run, even when I copy the dll files that it asks for over. What is the soloution? I did ask this before, but cant find the thread, so sorry for asking again.
I believe the solution did involve using Dependancy Walker - do I need to just copy the list of dll files that Dependancy Walker shows?
Thanks for any help - sorry for asking again!
Mike
|
|
|
|
|
Use regsvr32.exe to register the flex grid control.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan, I think that has sorted it!
Mike
|
|
|
|
|
I want to Communicate Vc stand alone application with vb standard exe.
Is it possible ?
i mean i want to use VC as a data gethering and data storing in database.
and VB exe is communicate with that vc appication for some current data gethering and that database for history datas.Is it possible or not ?
If it is Possible then please please guide me for above thing.How to do it ?
|
|
|
|
|
the CLR (Common Language Runtime) means that code can be written in one language and called in another.
As far as i know, this is limited to being able to interchange DLL functions / classes.
|
|
|
|
|
There are many IPC (inter process communication) options including (but not limited to) COM, RPC, shared memory. etc. I'd go for the COM approach.
Steve
|
|
|
|
|
|
Hi !!
I have DLL in my application.It is working properly in Debug mode but not in Release mode.I found the problem with CString and I had clear all those CString problems.But when i directly ru the application in release mode it shows the Application Error.I click cancel to Debug (i release mode only), it gives "Unhandled Exception".When i debugging the application (in Releasemode), i didn't get any application errors.
|
|
|
|
|
|
|
Check for uninitialized variables, especially pointers.
In debug mode, they get initialized to zero/NULL (by the debug memory handlers).
In Release, they doesn't get initialized, unless you do it yourself.
|
|
|
|
|
In addition to others I would recommend you to enter in the
Release <br />
<br /> directory of your project, delete all files inside and then Rebuild your
project.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Check that you have used an absolute filepath to find the DLL
|
|
|
|
|
Here is my "Debug works, Release crashes" checklist:
-check for uninitialized variables, esp pointers.
-check build settings that only release mode libraries used
-look for ASSERT's with non-const expressions - use VERIFY here instead
-in MFC, look for mismatched message handlers, esp for OCX's.
|
|
|
|
|
Hi all
Please tell me how to temrinate an EXE which was created from the VC++ application using "ShellExecute".
To use TerminateProcess(), we should pass the handle of the process. But i how can i obtain the handle when i use "ShellExecute"?
and also In CreateProcess() function i don't find any parameter for "passing the parameter to the application to be invoked".
Bye
|
|
|
|
|
S.R.Sasi Kumar wrote: But i how can i obtain the handle when i use "ShellExecute"?
You can't. Use ShellExecuteEx or, much better, CreateProcess to retrieve the handle.
From MSDN:
BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
So what you are looking for is probably here lpCOmmandLine
~RaGE();
|
|
|
|
|
Rage wrote: So what you are looking for is probably here lpCOmmandLine
I think you mean lpProcessInformation.hProcess .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Actually not, with this I was answering his second question "How to pass parameter to the invoked thing".
I agree I should have stated this more clearly.
This is not the first time you have corrected me these days, I should really pay more attention to my answers
~RaGE();
|
|
|
|
|
Rage wrote: Actually not, with this I was answering his second question "How to pass parameter to the invoked thing".
Fair enough.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|