|
David Chamberlain wrote:
then opens the file and reads the first 4 bytes (an int) to determine which data log version is required
That´s exactly what i do for my app. In fact, I have only _one_ type of structure, containing _all_ the stuff, and i only fill what is necessary given the version number. BUT i can do that only because i know there won´t be any further version (so the struct size won´t be larger) ... i guess that´s not the good solution anyway
~RaGE();
|
|
|
|
|
When faced with that problem, I typically use a file format that's similar to or based on the INI format. For instance...
[SoftareInfo]
Version=3
[Data]
SomeVariable = read me!
Bob = green
...
That way the code can just pluck out the variables it needs. If it doesn't find one it needs, it can use a default value.
This is also nice because it can be *forward* compatible too!
The one thing I *wouldn't* do is rely too heavily on MFC serialization. It can work in many cases, but if your file format has a major change, then your task becomes extremely difficult.
Of course, if you have *existing* file formats, then perhaps your classes that read data need to keep track of the version... like:
SomeClass::ReadData()
{
if(version >= 3)
read some piece of data
else
older versions stored that piece of data differently
...
}
Even if you win the rat race, you're still a rat.
|
|
|
|
|
I designed a DLL in .NET VC++ 7 with MFC. Can my DLL be used in VS6 application. I need to deliver MFC7 also. How can I do it ?
Any special concern in using the DLL in VS6 projects ?
|
|
|
|
|
Did you create the project using managed VC++ or just plain old C++? If it's plain C++ then there shouldn't be a problem to my knowledge. It's still just a DLL. If you used managed C++ then you'll probably have to use COM to access it.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
It's normal C++ DLL, unmanaged. However, it depends on MFC and also C++ Runtime library, right ? So, I'm worrying how to let users of VS6 to use it.
|
|
|
|
|
when drag & drop buttons from CToolBarCtrl, default drag icon is a small hand, i need my own icon for special required.
do u know how to change the small hand to my icon?
thx
includeh10
|
|
|
|
|
Already tried smthg with SetDragCursorImage() ?
~RaGE();
|
|
|
|
|
no, thx.
in which message if possible?
includeh10
|
|
|
|
|
includeh10 wrote:
in which message if possible?
Oh, hell, i really don´t know ... i do not even know how to find that out... this function has to do do with a CImageList, but i´m afraid you´re not doing stuff with MFC at the moment ... I´ll keep looking, hold on...
~RaGE();
|
|
|
|
|
Found that :
ImageList_SetDragCursorImage
BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag,
int iDrag, int dxHotSpot, int dyHotSpot);
Description: The ImageList_SetDragCursorImage function sets the image of the dragged item.
Parameters:
himlDrag and iDrag: Handle of the image list and index of the image.
dxHotSpot and dyHotSpot: The coordinates of the image’s hot spot.
Return value: TRUE if successful; NULL otherwise.
Does it help ??
~RaGE();
|
|
|
|
|
thank u, it really helps.
actually i use it many times in CTreeView, but never use in CToolBarCtrl, i can fix it soon, i think it's right function.
and, i'd like to say, u r a good and interesting mate, hope meet people as u often in my life.
cheers
includeh10
|
|
|
|
|
includeh10 wrote:
and, i'd like to say, u r a good and interesting mate, hope meet people as u often in my life.
Oh ... .. well, then, welcome at CodeProject, i think there will always be people here ready to help you, that´s the point of the forum ...
~RaGE();
|
|
|
|
|
I have used the mciSendCommand function in order to verify
if a CD-Rom unit is able to record data.
Syntax I have used is the following:
MCI_GETDEVCAPS_PARMS l_DevCaps;
......
l_DevCaps.dwItem = MCI_GETDEVCAPS_CAN_RECORD;
mciSendCommand(l_OpenParams.wDeviceID,
MCI_GETDEVCAPS,
MCI_GETDEVCAPS_PARMS,
(DWORD)(LPMCI_GETDEVCAPS_PARMS)&l_DevCaps);
Does someone know how this code doesn't work ???
Antony B.
|
|
|
|
|
pl.see this link may be use for you
http://www.nottingham.ac.uk/cal/publications/mcia2m.html
|
|
|
|
|
Hi in my application I call GlobalMemoryStatus() to get the status of the virtual memory of my system. It returns the fact I have loads of virtual memory, Great!!. However when I call new() to try to allocate memory that is less then the virtual memory (allocating quite a large amount but still less then the virtual memory)it is returning NULL due to there not being enough memory available.
Does anyone have an explanation for why this is happening?
Thanks
The Blade Runner
|
|
|
|
|
Memory allocation will fail if you don't have the required amount of contiguous memory available. Try running my product MemWatcher (free download) and see if that helps. Sorry for the shameless plug, but I think it may help you.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
This program only shows whats in Physical memory not virtual memory aswell. I know to memory I am trying to allocate is greater the just the physical memory but the virtual memory according to this GlobalMemoryStatus function shows it is big enough too allocate the memory.
Thanks anyway.
The Blade Runner
|
|
|
|
|
MemWatcher can free up memory that Windows mistakenly continues to flag as "in use", thereby possibly allowing more memory to be used by your program. However, if you try to allocate "x" bytes and there aren't "x" contiguous bytes available, the allocation will fail.
Unfortunately, simply increasing your virtual memory won't guarantee that it's actually usable, since none of the data currently in physical memory may be swappable.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I have developed an ActiveX control using ATL, when I insert it and work with it in Ms Word 2000 it works perfect, but when I print it, depending on the screen resolution, the Word text is printed inside the control or in the right place or shifted
I have tried the same in Word 2002 and it works fine. How can I fix this ? Is there any well know bug from ATL/Ms Word about this issue ?.
Thanks in advance
Braulio
|
|
|
|
|
For some reason I get a compiler error when I try to use chevrons in WTL. I define _WIN32_IE as 0x0500 (instead of 0x0400), but then I get the following error.
c:\...\wtl70\include\atlframe.h(274) : error C2146: syntax error : missing ';' before identifier 'lpnm'
I have IE version 6, I got VC 6 with service pack 4, and I got WTL 7.
What more do I need to get it working? As it looks like I'm missing a header file.
Any ideas? Thanks in advance
- Griffith
Everything you say will be misquoted, ripped out of context and used against you.
|
|
|
|
|
I just tried this today and got the same error. Unfortunately, I do not know why either. I think (but am not sure) that maybe WTL7 is for .Net and that is why it may not work. I believe that there is an ATL 2.0, ATL 3.0 and 7.0 and a WTL 3.0 and WTL 7.0. The only thing I can figure, since there seems to be a major jump in version numbers, is that 7.0 is for .Net.
Can someone clarify or verify this?
|
|
|
|
|
Hi,
I am in the process of converting all my MFC projects from VS6 to VS.Net and I'm getting a peculiar problem. My programs seemed to convert fine (with a few minor code changes). However, when I run my app it turns out I am having problems deserializing an object of a type of class defined in an extension DLL. I get the following TRACE output "Warning: Cannot load CMyClass from archive. Class not defined".
On the MSDN, it says that this will be a problem when using an extension DLL from a regular DLL. However, I am using the extension DLL from a regular MFC application - which the MSDN says should work fine.
MSDN link here (New window)
Does anyone have any idea why I am getting this error? I would be very grateful if anyone could shed some light on this issue.
Many thanks,
Mike.
|
|
|
|
|
I was going through some C++ code and found this syntax:
Complex **_W;
I do not understand the ** notation. Is it a pointer to a pointer? How am I supposed to initialize such an object and access its member functions?
Thanks. Looking forward to some replies
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Complex W;
Complex* pW = &W;
Complex** ppW = &pW;
Complex*pX = *ppW;
Complex X=**ppW;
double i=(*ppW)->i;
double j=(**ppW).j;
Easy really!
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
pankajdaga wrote:
Is it a pointer to a pointer?
Yes.
pankajdaga wrote:
How am I supposed to initialize such an object and access its member functions?
_W x;
*x = new Complex();
*x->ComplexMethod1();
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|