|
|
I'm really trying to help this guy, so I'm trying to understand if he needs some basic tips.
And, of course, trying to use a 'friendly' message!;)
Have a nice code day
|
|
|
|
|
SORRY guys. I'm a newbie in programming, know nothing , this is my 1st assignment to learn about C++. Thx for your help anyway. ;)
|
|
|
|
|
Ooops , forgot to tell you all never mind already, already can run the program with changing the front parts :
#include <iostream>
#include <string>
using namespace std;
Thanks again to all of you, thanks thanks thanks.
Danny
|
|
|
|
|
dannysoo2020 wrote:
A question is given as below:
Yes, but what problem are you having. We know what the assignment is, but you have not indicated the section of code that is troubling you.
See here for clues.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
|
|
Yes, of course I meant piss... err piece of code
|
|
|
|
|
Check "Ignore HTML tags in this message (good for code snippets)"! That will display your code better!
|
|
|
|
|
dannysoo2020 wrote: char *GetValue(char);
char *GetValue2(char);
char *GetValue3(char);
I thinkt that this should be:
const char *GetValue(char);
const char *GetValue2(char);
const char *GetValue3(char);
codito ergo sum
|
|
|
|
|
dannysoo2020 wrote: case 57: return "Nineteen ";
It working fine on my computer
"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
|
|
|
|
|
Hi!
I had download the source code of mass storage device driver for windows98 from Microsoft websit.And builded it with 98ddk on windows98 system,and then
installed it on win98 system. It can work correctly all the time.
If I suddenly remove the device from pc when copying file from pc to device or from device to pc on win98 system,the blue screen occur,and i have to restart my system.
But if do the same on win2000 or winxp there is no blue screen.
Now i wanna modify the driver source code to avoid the blue screen when suddently remove the device while it is exchanging data with pc on win98 system.
My question is:
1,If my hope has the possibility to come true?
2,If has,then which part of source code of this drive should i have to modify,and what couses the blue screen?
I know that in the source code it just abort all the pipes when device remove sudently but nothing else.
Thanks!
momer
All the blesses we are enjoy are the fruit of labor,toil,study and selt-denail.
|
|
|
|
|
Hi,
Is there any upgradation tool for migrating VC++ 6.0 code to VC++ 2005 code. This project in VC++ 6.0 has ATL and COM components.
Are there complete tutorial for this upgradation.
Is there any tool that upgrades atleast partially?
Any help in this regard is appreciated.
Sugan
Chennai
-- modified at 6:27 Friday 17th February, 2006
|
|
|
|
|
You can try opening it with Visual 2005 studio it will ask for converting teh code from VC++ 6.0 to vc++ 7.0
Cheers
|
|
|
|
|
You can try opening it with Visual 2005 studio it will ask for converting the code from VC++ 6.0 to vc++ 7.0
Cheers
|
|
|
|
|
|
Well thanx for the info.
Hey can you give me a link where i can fnd the diffrence between Vc++.net 2002 and Vc++.net 2005
Cheers
|
|
|
|
|
Hello,
I usually work with microcontrollers in a C/C++ environment, but i need to write a programm to download software in the microcontrollers (through RS232). I want to do this in Visual C++. I allready have written software that downloads the software correctly, but while downloading, my programm hangs. I would like to use multithreading to prevent this.
Whereever I look for help, it appears to be too complicated for a beginner like me. I just want my programm to have 2 threads: 1 for the serial communication and 1 for the GUI.
|
|
|
|
|
u can use CreateThread() function for this. The function creates a new thread.
eg:
CreateThread( 0, 0,(LPTHREAD_START_ROUTINE)ThreadProc, 0, 0, 0 );
When the above function is called, anew thread will be created and it will call the function ThreadProc
The function ThreadProc must be define as
DWORD WINAPI ThreadProc(
LPVOID lpParameter
)
{
// begining of new thread
}
nav
|
|
|
|
|
If you plan on using any CRT functions (C/C++ runtime) like malloc etc, then rather than using CreateThread, you should use _beginthreadex. You need to make sure that you're building a multithreaded app and using the right versions of the runtime libraries. A simple check is
#if !defined(_MT)
#error "Not building correctly"
#endif
since selecting multithreaded runtine libraries will defined _MT as a preprocessor symbol. Of the arguments to _beginthreadex, you are usually best passing 'security' as NULL, stack_size as zero.
If you've never used multiple threads before, then you're in for a treat, since it will involve an element of synchronisation.
Steve S
Developer for hire
|
|
|
|
|
bolleperdu wrote: Whereever I look for help, it appears to be too complicated for a beginner like me. I just want my programm to have 2 threads: 1 for the serial communication and 1 for the GUI.
http://www.flounder.com/workerthreads.htm[^]
"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
|
|
|
|
|
Thanks for the response! The problem is that I want to show how much of the serial data is allready transmitted.
My programming skills are extremely basic: I create my forms using the windows form designer , I don't create them from my own code.
Would using the class "using namespace System::Threading;" for my threading be the easiest way?
<br />
try<br />
{<br />
StreamReader^ sr = gcnew StreamReader(teversturen);
{<br />
String^ line;<br />
int lengte = (unsigned int)sr->BaseStream->Length; <br />
int percent; <br />
while (!(sr->EndOfStream::get()))<br />
{<br />
percent = (((unsigned int)sr->BaseStream->Position / lengte) * 100);
toolPCT->Text = percent.ToString() + "%";
<br />
line = sr->ReadLine();
sp->WriteLine(line);
Form1::Update();
}<br />
}<br />
sr->Close();<br />
<br />
}<br />
catch (Exception^ e)<br />
{<br />
richTextBox1->Text += "The file not be read:\n";<br />
richTextBox1->Text += e->Message + "\n";<br />
sp->Close();<br />
}
Above you can find my code. I would like the percentage to be shown at least with an accuracy of 10 pct, or an update every 2 - 5 seconds. If this could be achieved without multithreading, that would please me even more:p The serial communication takes lots of time and the users would like to be able to cancel, see the status, ...
|
|
|
|
|
Hi, All.
I have problem in my app. In my app, i have aciton [COPY File/Folder], switch Window Explore. When you right click > Paste, i want to active my app to run some function. after that, Do Paste.
Now, i will use hook to do that but i don't know, when window explorer paste, it call what API function.
Please, help me to to solve this problem.
Thanks.
|
|
|
|
|
Normaly pasting is accomplished through the clipboard; that is you query the clipboard for the current items available for pasting. You can search for pasting in the MSDN, but you might have more success looking at OLE information on things like "drag and drop". Unless you need to know specificaly that the item being pasted is coming from Windows Explorer, then you should not need a hook. Of course if the function doing the pasting is in a control that you are using in you application, then you would need to hook that control.
INTP
Every thing is relative...
|
|
|
|
|
thank you very much. i try and will send you result.
|
|
|
|