|
Thank you Sir.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ok, thanks for your try
|
|
|
|
|
That's because you misspelled "codez".
|
|
|
|
|
CPallini wrote: send me codez sir, plz plz urgentz...
www.cpallini.freeproducts.com[^]
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
See Registry Wrapper Class (CRegistry)[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
But here there isn't any idea how to enumurate the subkeys!!! just of values of keys
|
|
|
|
|
You need to little work for do it.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
|
But in the first page it is specific to VB code programming and me i want C plus plus code
|
|
|
|
|
They're all Win32 API calls. They're easier to use from C++ than from VB. If you can't work out how to enumerate registry keys from that example, then you'd best start practising burger flipping.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hai!
I have an byte array. Now i need to display this data as an bitmap image in my dialog (in embedded Visual C++)?
Is it possible, if possible How can i do it ?
Thanks!
|
|
|
|
|
You probably have to convert your (probably) raw data to a bitmap.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
It's a two-step process:
- First, You must know what is the data format of your raw image.
- Then, you have to actually create the Windows Bitmap.
If you have a look at the source code of my "Plain C resampling DLL" [^] then you may have a clue on how the second step is performed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
This is related error to a C std function strtoul.
This problem started coming up when I migrated from VS 2003 to VS 2008.
While building c code I am getting the following error:
############################################################################
libcmtd.lib(strtol.obj) : error LNK2005: strtoul already defined in test.lib(string.obj)
c:\xyz.exe : fatal error LNK1169: one or more multiply defined symbols found
*** Error code 1169
clearmake: Error: Build script failed for
"c:\xyz.exe "
############################################################################
This error tells us that while building the libcmtd.lib it got the definition of the strtoul function in the test.lib
The std strtoul function is defined in the file strtol.c which is a standard file like stdio.h.
I have also customized definition of this function defined in my project.
While building the code my project references the customized code and not the std function
I want to use the standard strtoul function.
The customized strtoul is not be removed completey as some files need to reference the customized strtoul while some part will refer the original strtoul.
Any solution for it ?
Why is the VS2008 linker using the customized function instead of using the standard one.
What the difference between VS2003 and VS2008 which is causing the error.
|
|
|
|
|
Why don't you just change your function name (e.g. from strtoul to custom_strtoul )?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks Pallini for the reply.
I cannot change the function name as it it is referenced at many places
. If I change the name then all these places will have to be changed which is not desired.
|
|
|
|
|
rupeshk_p wrote: If I change the name then all these places will have to be changed which is not desired.
Why?
You may also use an old-dirty-trick on such files:
#define strtoul customized_strtoul
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
rupeshk_p wrote: I have also customized definition of this function defined in my project.
Why re-use the name of a function defined in the standard? That seems the foolish thing to me - if you'd just used a different name, than a) you'd not have these linker problems, and b) you'd be able to see exactly where you used the 'customised' function.
rupeshk_p wrote: Why is the VS2008 linker using the customized function instead of using the standard one.
Probably because the linker sees your definition is test.lib(string.obj) before it sees the one in libcmtd.lib.
rupeshk_p wrote: What the difference between VS2003 and VS2008 which is causing the error.
The behaviour actually changes between VS2003 and VS2005 (yes, I've tried it, with VS2003, 2005 and 2008) - VS2008 just follows VS2005's behaviour. The only thing I can think of is that the C run-time now requires strtol, and so will bring in strtol.obj (which contains both strtol and strtoul). [later] This would appear to be confirmed - when I compile and link this small program (which I've called a.c):
#include <stdio.h>
int main()
{
printf("%d\n", 1);
} with the command cl a.c /link /map , the map file contains strtol when built with VS2008, but doesn't when built with VS2003.
rupeshk_p wrote: Any solution for it ?
Add implementations of all the functions exported by strtol.obj from libcmtd.lib?
|
|
|
|
|
Thanks Stuart for the details
The same name of the customized function is as per deisgn
I cannot use a different name for the customized function
You are correct that the linker sees the definition is test.libfirst and then in libcmtd.lib which causes the error.
From the sample code you have shown it imples that the vs2008 build includes the standard strtoul while the vs2003 does not
Am I correct ?
|
|
|
|
|
Yes. As I said - the runtime (that bit that you have to have) must have changed to link it in
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Can you let me know what does the terms _Check_return_ and _CRTIMP means
in the definition below
_Check_return_ _CRTIMP unsigned long __cdecl strtoul(_In_z_ const char * _Str, _Out_opt_ _Deref_post_z_ char ** _EndPtr, _In_ int _Radix);
|
|
|
|
|
I'll do better than that - I'll show you how to find them yourself:
- Right-click on the thing you want to find the definition of and select "Go To Definition"
- There is no step 2
[edit] However, most of those macros actually resolve to nothing when you're compiling normally - the _Check_return, _In_z_, _Out_opt_, _Deref_post_z_ and _In_ macros only have a definition if you're using the PreFast static analysis tool. [/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Digging further into stdlib.h of VS2003 saw
#ifndef _CRTIMP
#ifdef CRTDLL
#define _CRTIMP __declspec(dllexport)
#else /* CRTDLL */
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* CRTDLL */
#endif /* _CRTIMP */
So _CRTIMP is a #define which tells whether the function is exported from or imported to the C library.
_Check_return_
Return value must not be ignored by callers of this function.
|
|
|
|