|
Tom Wright wrote:
Do I still need to add the defines even though it will never run on anyhting below W2k?
Yes, from the FAQ:By default, you can only use functions in Windows 95, NT 3.51, and pre-IE3 common controls. To use APIs introduced in later versions of Windows or the common controls, you need to #define the above symbols correctly before including any Windows headers. To be safe, I always define those symbols no matter what. Some of the headers will override the defaults, for example some headers will have this:
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#endif but then you're at the mercy of whoever wrote the header file and what he thought a "good" version was.
Here's what I use:
#define WINVER 0x0500
#define _WIN32_WINDOWS 0x0410
#define _WIN32_WINNT 0x0500
#define _WIN32_IE 0x0501 which enables features in 98+, 2000+, and IE 5+.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot stop me with paramecium alone!
|
|
|
|
|
I added these define statements before my header files and now I'm down to one error but it's the same one.
One other question. Do I need to add the
Michael Dunn wrote:
#ifndef _WIN32_IE#define _WIN32_IE 0x0500#endif
Statement after the defines statments and insclude all the different defines?
Any other suggestions?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
This is really strange. I've added in the defines and it still does not find the function. When I search the winuser.h file for the function is does not exist. It resides in the winuser.h file in the include folder under .NET studio.
According to MSDN is says that it is defined in the winuser.h file and is compatable on 98 on up. If I copy over the file from .NET studio to the VC98 then I get 53 errors.
Has anyone used this function on a regular C++ app before?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi,
I´ve have written an Outlook automation (whith wrapper classes).
After this Outlook crashes sometimes without any known reason.
Outlook starts an dialog where the user can send this report to Microsoft.
What kind of problems could Outlook have after automation ?
Is there a way to find the problem in the report ?
regards, JohnX
|
|
|
|
|
Does anyone know how I can get the VS.Net IDE to show me a list of the available messages for a control that's created dynamically in a view? You know, like you get when you select a control on a dialog or a form in the res editor... It's a pain to code this stuff manually
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Why not place the control on the form in the res editor, write all the code to handle it, then remove the control from the form?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Well, I'm not using a form, I'm putting the control in a CView. I decided to throw together a junk project and use it to do like you suggested, but I still have to copy/paste in all the wiring. Oh well...
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
yeah, sometimes life can be a bee with an itch.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Where do you allocate the space for nomarchc?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Yes this code will not even compile. I assume name is incorrect.
John
|
|
|
|
|
sorry
it was wrong i edited it and it still gives me an error
|
|
|
|
|
don't the following work ?
<font style="color:blue;">#include</font> <stdio.h> <font style="color:green;">
<font style="color:blue;">#include</font> <stdlib.h> <font style="color:green;">
<font style="color:blue;">#define</font> MAX_WORD 51
<font style="color:blue;">int</font> main (<font style="color:blue;">void</font>) {
<font style="color:blue;">char</font> nomarchc[MAX_WORD];
printf(<font style="color:gray;">"insert file name:"</font>);
scanf(<font style="color:gray;">"%50s"</font>, nomarchc);
return 0;
}
your problem with free() can come from your
name=(char*)malloc((sizeof(char))*MAX_WORD);<br /> line, where you allocate a memory area, but you store it into name instead of nomarch...
TOXCCT >>> GEII power
|
|
|
|
|
one problem that i can see is that if you type more than MAX_WORD i.e 51 chars it will give problem. free will cry.
|
|
|
|
|
Your code as written seems to work as intended. So I'm not sure what your problem is unless you're walking over the end of the buffer. It would be better to write your scanf line thus,
scanf ( "%h50s", nomarchc ) ;
Where the width specifier is always one less than the size of the allocated buffer to allow for the trailing null.
Paul
|
|
|
|
|
i solved the problem
thanks
it was an overflow problem
i wrote more than 50 positions
|
|
|
|
|
I have this kind of error when I use the application I work on. No error at compilation but this error appears when I use one the functionality:
"The instruction at "0x01604f3d" uses the memory address "0x0000030a". The memory can't be "read" "
Can you help me ?
|
|
|
|
|
Launch your application with the debugger (F5) and see where it crashes)
|
|
|
|
|
I've done it...
And when I put a breakpoint where it crashes, there is no error !
It's incredible but I have no idea on this subject
|
|
|
|
|
basic stuff to check : variables initialisation, error checking on memory allocations, ....
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Make sure you're not trying to access an element of an array beyond the array's bounds. If you're using vector, put in a catch/try block and see if it's throwing an exception somewhere. Look carefully and triple-check any hand-written for or do/while loops.
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hi.
I like to know if there are some kind of advantages in VS 7.0 if I write application with just MFC and Win32 SDK.
If there are, wich are? Just a few examples.
Thanks.
Demian.
|
|
|
|
|
While it doesn't directly answer your question, I'd like to offer this. Don't buy the latest version of something just because it is the latest version. Like any tool, a compiler is meant to solve a problem. Each problem has a set of requirements. If the compiler can meet each of those requirements, then that's the tool for the job. While the newer versions of Visual C++ have more bells and whistles than older versions, you have to ask yourself if those bells are whistles are "wants" or "needs."
For the past 11 years, my work has been solely governed by the clients for which we sell to. I don't have an exact date, but it was many years after Windows 95 was released, our clients were still using 16-bit Windows. The developers, myself included, were in agony because we could not update our development tools. When clients started buying new computers that came with Windows 98 pre-installed, only then did we get the go-ahead to buy and use Visual C++ v5.
Even today, I have no business reason to use anything other than Visual C++ v6. The clients that use our software are mostly Windows 98 and Windows 2000. I'm sure a handful of them are probably using Windows XP. But the biggest factor is that the EXE that our DLL hooks up with is still being compiled (by IBM) with Visual C++ v5. They might be using v6, but I can't say for sure. Any new development that they do, however, is in Java.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yes, that's totally true. I understand what you say.
I thought about substantial changes or advantages, por example in serialization, maybe is more simple or diferent, I don't know, something like that.
Because I'm going to developed a new application and maybe the serialization process is better or easy in VS 7.0.
Well, thank you very much.
Regards from Argentina.
Demian.
|
|
|
|
|
Well said, David! I have both VC7.1 and VC 6 and for some reason, I keep going back to VC6. Call it comfort, call it habit, it just plain works. And if it ain't broke....
onwards and upwards...
|
|
|
|