|
thanks for the help... i'll try and get back. thanks.
|
|
|
|
|
Preeti Mishra wrote: can you give me the code?
What is it with people on here? Do they think we have nothing better to do than sit in front of the computer waiting for somebody to ask us to write code for them?
I will say it once again. Do the work yourself! If it doesn't work, then show us what you did, maybe we can help you fix it. But under no circumstances would anybody on here hand out code, especially not after a question like "Can you give me the code", and certainly not if you want to be cheeky enough to not even say 'please'!
|
|
|
|
|
very correct... i vote in full for your post..
|
|
|
|
|
When we connect VC++ with Mysql libMysql.lib error
but when we download Mysql there is not any library
how we manage is
Please help me
mailing me
Yogendra
|
|
|
|
|
You're getting an error sayng you need a lib ? MySQL probably doesn't come with it, there's probably an SDK you need.
|
|
|
|
|
yogikaushik wrote: When we connect VC++ with Mysql libMysql.lib error
Did you try googling the error? I did and there are lots of results. Google: libMysql.lib[^]
There are a couple of hits that talk about the exact issue your having.
Good luck
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
here is an article found on the internet:
http://www.herdsoft.com/ti/davincie/leon5i44.htm
which has following code:
//----------------------------------
TDib * theDib = new TDib( "MEINE.BMP");
HGLOBAL hg = HANDLE( *theDib );
LPBITMAPINFOHEADER pbm=(LPBITMAPINFOHEADER)GlobalLock(hg);
//----------------------------------
is it necessary or useful to lock a "new" pointer as code above?
|
|
|
|
|
It's actually locking a handle returned from the TDib * ( presumably an operator is defined to do this ).
|
|
|
|
|
do no type sentence which says nothing.
|
|
|
|
|
includeh10 wrote: do no type sentence which says nothing.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
erm...whats the process for creating a regular dll in visual 2005 express edition?
seems to be something which should be a doddle....
Bryce
-- modified at 20:32 Monday 13th November, 2006
|
|
|
|
|
Maybe the express edition is different, I am not using that one, but I have to do File->New->Project...->Win32->Win32 Project->Ok->Application Settings->Dll->Finish
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
correct there is a difference...the dll option is disabled.
i'm leaning to the thought that expess edition doesnt allow you to build something as basic as a dll
Bryce
|
|
|
|
|
Well that sucks;P
Here is something you can try, no guarantees it will work though:
Create a Win32 windows app, Then go to windows explorer, find the vcproj file for your project. Open it in a text editor, find the line that says "PreprocessorDefinitions=" and add the _USRDLL preprocess definition.
Then goto the source files and remove WinMain and add DllMain.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Also, while you are in the vcproj file you should also adjust the linker options.
Look for the linker tool section, change the output name to a dll extension, and add the line:
ImportLibrary="$(TargetDir)$(TargetName).lib"
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I created a very simple program in C++ that displays math problems the user must answer. I am trying to use a timer to diplay the time elapsed and fprintf() the time to a file for high scores (or low scores). I have included timer.h and I can display the time to the screen, but cannot write the time to a file. The timer displays the correct time, so I know it is working, but I cannot figure out how to assign the timer a variable or export it directly to the file. Any help would be appreciated.
Kenny
jmarkey@iastate.edu
|
|
|
|
|
If it's a console application and you're using SetTimer see this[^] article.
Steve
|
|
|
|
|
jmarkey wrote: I can display the time to the screen, but cannot write the time to a file.
If you are using fprintf(stdout, ...) to write to the screen, why not just replace stdout with a FILE pointer?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am trying to read and write to the same file. Could this be a reason it is not writing? I open and close the file twice, once to read the scores "r" and once to write a score in "w". This is inefficient, but quick enough for my purposes. Is there any reason this will not work?
|
|
|
|
|
jmarkey wrote: I am trying to read and write to the same file. Could this be a reason it is not writing?
I doubt it.
jmarkey wrote: I open and close the file twice, once to read the scores "r" and once to write a score in "w".
Shouldn't be a problem. You could also open the file once in read+write mode, but that is unrelated to your problem.
That said, what exactly is the problem you are seeing?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am trying to extract a value from a timer to compare it with other values (high scores). However, all timers I have tried return a double that cannot be manipulated, and displayed only by using the code-
cout << "\n\nYour time is " << t;
I don't know how exactly that code operates, so I would like to be able to use printf() to display the time. If you know of a timer that returns a value (to the hundredths place) that can be manipulated, please reply.
|
|
|
|
|
jmarkey wrote: However, all timers I have tried return a double...
This makes no sense. SetTimer() and the WM_TIMER message have no knowledge of double types. Perhaps you are thinking of something else.
jmarkey wrote: cout << "\n\nYour time is " << t;
Why are you not using endl ?
jmarkey wrote: I would like to be able to use printf() to display the time.
If you are writing C++, why?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
point 1: What is SetTimer() and WM_TIMER? I included the header file "timer.h" to time my program. I declare a timer t, start it with t.start(), stop it with t.stop(), and display the time as described before. While debugging the program, I inserted a breakpoint after t.stop() so I could check the value of it. I noticed the timer t had several sub-values. There are two long floats start_clock and start_time that I think have to do with the CPU clock ticks. There is also a double called acc_time that is what I am trying to extract from t. It is a decimal to the hundredths place and is exactly what I am trying to fprintf to the highscores file. This was the double I was referring to, sorry if I was not clear.
point 2: What is endl? I assume it is short for "endline" or something like that, but I have never seen and do not know how to use cout<
|
|
|
|
|
jmarkey wrote: What is SetTimer() and WM_TIMER?
SetTimer()
WM_TIMER
jmarkey wrote: What is endl?
endl
jmarkey wrote: Why does using printf() to display the time hinge on writing in C++?
Not exactly sure what you mean by this. While printf() can be used with both C and C++, most folks move on to streams (e.g., cout ) when they do C++ work.
jmarkey wrote: I would like to use printf() to write to the highscores file.
I already mentioned using fprintf() for this.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think we are misunderstanding each other. Here is what I know:
1. I can write to the file using fprintf(), and have done so.
2. I can time my program and print the time to the screen using cout
Here is what I don't know:
1. What the heck is a stream? I have never heard of streams before.
2. I explained what values the timer contained in the last post. How can I
access the acc_time value? (acc_time is a double)
3. I am timing functions as they happen. I don't see how Set Timer() and
WM_TIMER will help, because as far as I can tell these timers count down to
zero. I need one that will count up until I stop it, and return a value
that can either be used in printf() or fprintf(), or converted to be used
in those functions.
So the only thing I am trying to do right now is figure out a way to get the time in a manageable form so I can manipulate it. Thank you for your help so far.
|
|
|
|