|
pHead is a pointer to a SHeadFeatures object. It's assigning the address of features->Head to pHead .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
it means pHead is a const pointer that cannot be modified,
and &features->Head means the same as features.Head
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
Hi,
always I try #include <iostream> in the header-file of my .NET-dll I get this error:
error LNK2020: Unresolved Token (0A000017) _CxxThrowException
error LNK2020: Unresolved Token (0A000019) delete
If I try this in a .NET-console application that error doesn't occure.
Any hints?
|
|
|
|
|
MC++ dlls are not linked to CRT by default. Add msvcrt.lib to your Linker->Input->Additional Dependencies
|
|
|
|
|
|
Hi..
dose any one has idea of how to convert files format if it possible after that to still able to run the file such as *.bmp files to *.gif ..
i tryied to do that using CFileFind but the file did not open then..
|
|
|
|
|
Are you trying to convert bmp to gif using CFileFind ??
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
if ur doing grafic file conversions lookup csimage here on cp
"there is no spoon" biz stuff about me
|
|
|
|
|
First off I must admit I don't know if this is the rigth forum to post in, btu since I'm trying to do this in an MFC app of mine I hope it's ok
I'm currently experiencing some "simple" memory problems between my .exe and it's runtime-linked DLL.
If I allocate an object on the heap (using new) and try to deallocate it in the DLL (using delete, of course) I get a memory error kind of sounding like this:
HEAP[Adventure Editor.exe]: Invalid Address specified to RtlValidateHeap( 05180000, 00387A28 )
I traced into the C code and found out that the following code:
<br />
<br />
_ASSERTE(_CrtIsValidHeapPointer(pUserData));
Since I know the pointer isn't bad it must be something about a DLL not sharing the .exe's heap.
Is that so? And if yes, why? I thought a DLL was loaded into the .exe memory?
|
|
|
|
|
Halloko wrote:
I thought a DLL was loaded into the .exe memory?
I agree with you, but I would say that its really not a safe way to allocate the memory in .exe and delete in the dll. Simple rule of thumb, the owner of the pointer should delete it.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
Halloko wrote:
Since I know the pointer isn't bad it must be something about a DLL not sharing the .exe's heap.
Is that so? And if yes, why? I thought a DLL was loaded into the .exe memory?
It is about CRT. If you dinamically link to CRT in both dll and exe, than you are OK. Otherwise, you have two instances of CRT loaded in the memory, and you'd better make sure to free the memory with the same instance you allocated it with.
|
|
|
|
|
I do not think it is even possible to load a DLL into an exe address space if the exe is not compiled using dynamic linking.
Kuphryn
|
|
|
|
|
"SystemTimeToTzSpecificLocalTime" Windows Platform SDK call seems to satisy what i want to do. But again to populate the _TIME_ZONE_INFORMATION struct is a problem. Generally it is populated from the local TimeZone (Environment variable). Any Hints/Help to populate this struct with a non-local Timezone data.
BOOL SystemTimeToTzSpecificLocalTime(
LPTIME_ZONE_INFORMATION lpTimeZone,
LPSYSTEMTIME lpUniversalTime,
LPSYSTEMTIME lpLocalTime
);
typedef struct _TIME_ZONE_INFORMATION
{ LONG Bias;
WCHAR StandardName[32];
SYSTEMTIME StandardDate;
LONG StandardBias;
WCHAR DaylightName[32];
SYSTEMTIME DaylightDate;
LONG DaylightBias;
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION;
Also i was wondering if anybody has seen the MultiTimeZone Clock Screen Saver. If the source code of that could be got it would make life simpler.
Dimple
|
|
|
|
|
DimpleSurana wrote:
Any Hints/Help to populate this struct with a non-local Timezone data.
I live in GMT-0600, which is known as CST here in the U.S. If I wanted the time for EST, or GMT-0500, I would do something like:
TIME_ZONE_INFORMATION tzi = {0};
SYSTEMTIME stUniversal = {0},
stLocal = {0};
tzi.Bias = 300;
GetSystemTime(&stUniversal);
SystemTimeToTzSpecificLocalTime(&tzi, &stUniversal, &stLocal);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi David,
I really appreciate the code snippets you give me. But i wanted to know that how do i add DST information to it too. For eg. EST timezone see's DST.
I idea is that "stLocal" will be given its TimeZone only once & hence forth onwards it should always know its TimeZone's Time including DST.
Thanks,
Dimple
|
|
|
|
|
Check out the DaylightBias member of the TIME_ZONE_INFORMATION structure.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Do u have ne generic solution that will update the time object based on the incoming timezone.
This is gonna require some manual programming i believe so was loking otu for a code snippet.
Dimple
|
|
|
|
|
Nothing that revolves around a "timezone identifier." Otherwise, the DaylightBias and Bias members should solve your problem.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi!
Having problem by using sprintf. I have the hexadecimal 2B67, and will convert it to decimal by using sprintf.
Can someone help me?? I know how to do vice verca.
|
|
|
|
|
As far as i know there is no datatype called hexadecimal.
What is the actuaal data type wheather its Int, long, or string
if its string then you need to convert it to long or int and use the following statemetn
printf("%d",nHexNum);
or
printf("%ld",lHexNum);
Which ever fits rite.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
Mr.Prakash wrote:
As far as i know there is no datatype called hexadecimal.
Then what do you call base-16 numbers?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
humm, is there any data type called base-16 in c/c++????
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
No, but there are base-16 numbers, also known as hexadecimal numbers. Referring back to styve's post, he wanted to convert a base-16 number (hexadecimal) to a base-10 number (decimal).
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I certaily agree with you? I was trying to be within the context of C/C++,
Many newbies consider this as hexadecimal no.
int x = 0xff;
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
Mr.Prakash wrote:
Many newbies consider this as hexadecimal no.
int x = 0xff;
While 0xff is indeed a hexadecimal number, the variable x is simply a spot in memory.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|