|
toxcct wrote: has nothing to do in a C++ code.
Yes, But interesting to see, why he is facing problem.
Strange that people expect help without giving sufficient information.
|
|
|
|
|
Sometimes I wonder why you are a CP MVP.
I work with a large amount of legacy C code that use malloc/calloc/realloc/free I cannot, will not change that because it works and has been working for the last few years.
The question is valid, albeit not well "asked", in this forum.
|
|
|
|
|
There could be any nuber of reason why calloc() would fail. At the point of failure, what values are being passed to it?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If it returns NULL , it is a failure, like an out-of-memory or out-of-address-space condition. If it returns a non-NULL value, but things crash when you try to use it (i.e. it is truly invalid), then I would offer that the heap information used by calloc(...) is messed up,or you are going too far with the pointer returned.
Although, since calloc(...) has to actually touch the memory to initialize it to zero, it should crash within the call to calloc(...) if the memory it allocated is really invalid.
So, what do you mean by "returns bad pointer"?
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I'm trying to make a window class for my own context menus. (Like QPopup)
The problem is that this window should get focus without activation. (Parent window shouldn't lose activation)... May be anyone know how to do this?
|
|
|
|
|
I have created a VC++ application. I want to create a setup of the project (exe and supporting files). How to do with Package and deployment wizard or any other wizard.
Thanks in advance.
|
|
|
|
|
|
|
Hi
Can we all API used in VC++6.0 in VC++.Net. If we have open old project of VC++ 6.0 to VC++.Net then what changes are necessary to run that project sucessfully
Atool
|
|
|
|
|
M. Atul wrote: Can we all API used in VC++6.0 in VC++.Net.
Naturally
M. Atul wrote: If we have open old project of VC++ 6.0 to VC++.Net then what changes are necessary to run that project sucessfully
Depends how good the programmer was. You may need no changes, you may need a lot. VC6 was a poor C++ implimentationm only coders who know the standard and coded to it would have no issues.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Are you talking about converting to VC8 with MFC, or converting to the CLR with Forms?
If you're talking about going to VC8 with MFC, it might take a couple of hours, depending on a) how large the code base is, and b) how talented the programmer doing the conversion is.
If you're talking about going to CLR/Forms, I think it would be best to just start from scratch.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Is it possible that add background image to (MFC)Editbox(and Other Control)?
Please Answer..
Have a nice day.
-- modified at 7:13 Thursday 18th January, 2007
|
|
|
|
|
Other controls, yes. Edit boxes, no. They are painful things, not well written
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hello,
Did anyone know how to get the current process id using an VS6 API function.
GetProcessId is VS7 compatible, i cannot use it.
|
|
|
|
|
aliaa wrote: get the current process id
Doesn't ::GetCurrentProcessId() help?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
The Windows APIs are provided by the Windows OS, not VS.
A quick glance at the Platform SDK for the GetProcessId() API tells me it's for XPSP1 and above.
I would assume it may not be in the header files included with VS6 so maybe you need a newer
platform SDK.
Mark
|
|
|
|
|
Hi
all
I want to write resource dll in VC++, for this i want to copy resources from my old project to new resource dll, so please send me info of how to copy resources?
Thanks
Atool
|
|
|
|
|
This is true for VC6 - though I think it would be true for later versions.
Open your new project in the IDE.
Then use File | Open, set the Open As to Resource, and load the DLL.
Then drag the resource from the opened DLL to the resources in the New project.
Iain.
|
|
|
|
|
I'm building a project under Visual Studio Express 2005. I have imported some old functions (contained in a .h and .cpp file) and am trying to add them to the project, but am having very little success. I am getting the following errors:
error LNK2028 unresolved token
error LNK2019 unresolved external symbol
But I have included the header file. I'm a little puzzled. Any help would be appreciated.
Windows with no internet connection is safe, but that's not what Windows was built for.
|
|
|
|
|
The Apocalyptic Teacup wrote: But I have included the header file.
You need also to add the cpp file to your project.
|
|
|
|
|
Cedric Moonen wrote: You need also to add the cpp file to your project.
Yes, I have done that. This is why I don't understand what the problem is...
EDIT:
The header file contains the function prototypes and the cpp contains all the function code. I have added them both (.h and .cpp file). The strange thing is that the IDE recognizes them, but during linking I get the unresolved token errors. I wonder if this is a problem with VC++ Express 2005?
Windows with no internet connection is safe, but that's not what Windows was built for.
|
|
|
|
|
For anyone interested:
I moved the contents of the .cpp file into the .h file and it seems to compile and work now. I suspect a problem with the Visual Studio express compiler...
Windows with no internet connection is safe, but that's not what Windows was built for.
|
|
|
|
|
The Apocalyptic Teacup wrote: I suspect a problem with the Visual Studio express compiler...
No, I hardly doubt that is the problem. How did you add the cpp file to your project ?
|
|
|
|
|
Cedric Moonen wrote: No, I hardly doubt that is the problem. How did you add the cpp file to your project ?
I have a Windows form application. In, say, Form1, I have code that performs some calculations. Previously I had written a large number of statistical functions in the aforementioned .h and .cpp files. I have included these files in several projects with no problems and I know they work. I moved them into the project directory for the form application (I'm on someone else's machine) and added them to the project (Using Add... on the solution explorer). I did a #include <statistics.h> in the code for Form1 and tried to build the solution. This gave me the unresolved symbol errors. It's a little strange. I removed them from Form1.h and included them in StdAfx.h with the same results. The only way to remove the unresolved symbols problem was to merge the .cpp file into the .h file. I'm baffled.
Windows with no internet connection is safe, but that's not what Windows was built for.
|
|
|
|