|
If thay have spaces between them then the code I have should work. If they have spaces in them it will not.
Steve
|
|
|
|
|
I got it
I read each line into an an istringstream object and i use getline(buffer,num_chars,'\t')
to seperate the the string.
COOL
Kelvin Chikomo
|
|
|
|
|
How to read Windows User Name and the machine Host name in a VC application ?
|
|
|
|
|
The function NetWkstaUserGetInfo can be called to get the User Name.
The function NetWkstaGetInfo can be called to get the computer name.
There are security restrictions in place that could cause these calls to fail, though.
Chris Meech
I am Canadian. [heard in a local bar]
When I want privacy, I'll close the bathroom door. [Stan Shannon]
BAD DAY FOR: Friendly competition, as Ford Motor Co. declared the employee parking lot at its truck plant in Dearborn, Mich., off limits to vehicles built by rival companies. Workers have to drive a Ford to work, or park across the street. [CNNMoney.com]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
RadioOpa wrote:
How to read...Host name in a VC application ?
Try gethostname() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
RadioOpa wrote: Windows User Name
GetUserName
RadioOpa wrote: machine Host name
GetComputerName
"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
|
|
|
|
|
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
|
|
|
|