|
Well, since the contract/specification of STL's vector states that is has to use a contigious block of memory, you could write out the # of elements in one of the vector s and write out the entire block in one WriteFile(...) operation.
The address of the first element of the vector would be the start of the memory block allocated to it.
Peace!
-=- James (Sonork:100.21837)
[Tip for SUV winter driving survival: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"!] [Get Delete FXP Files Now!]
|
|
|
|
|
Hi.
I have very wierd problem with this common dialog. If i call it in my program it works fine, kind of. I get path's & filenames and everything. No problems at all, but after calling the MFC-version or the WINAPI-version of the dialog all other file IO's will fail for no reason. Just simply fails. For example fopen() fails every time after one filedialog-call. Without that call fopen works fine.
I have no idea why this happens. 
|
|
|
|
|
I guess something is trashing the memory, are you supplying a correct buffer for the files?
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
I call it like this:
char strFilter[] = "JPEG image|*.jpg||";
CString pathName;
CFileDialog dlg(TRUE, NULL, NULL, OFN_FILEMUSTEXIST, strFilter);
if (dlg.DoModal() == IDOK)
pathName = dlg.GetPathName();
Then i set up my image class with the filepath, but file open fails, because of filedialog. (or so it seems)
if i hardcode the path to imageclass everything runs smoothly...
Im just interested about the path of the file.
|
|
|
|
|
Hi All,
I want to Play an EMF file to a memoryDc & then display it to the screen using the BitBlt function.
Iam doing it as follows: ,but I dont see anything on screen.
I guess its because,I have to select the Emf Object into the MemoryDc.Is that So?
If yes,How could I select the Emfhandle into the memoryDc,as "SelectObject" takes only things like CBrush,Cpen,Cfont Etc...
CDC dcMemory;
//m_deviceContext is the destination device Context.
//meta_handle,Handle to MetaFile.
dcMemory.CreateCompatibleDC(m_deviceContext);
PlayEnhMetaFile(dcMemory,*meta_handle,&rect);
m_deviceContext->BitBlt(0,0,rectwidth,rectheight,&dcMemory,0,0,SRCCOPY);
Hoping for a Reply
Thanks....
|
|
|
|
|
add this line before PlayEnhMetaFile
CBitmap memBitMap;
memBitMap.CreateCompatibleBitmap( &dcMemory, 400, 400 );
dcMemory.SelectObject(&memBitMap);
|
|
|
|
|
I did as follows,but still I cant see anything on screen..
CDC dcMemory;
dcMemory.CreateCompatibleDC(m_deviceContext);
CBitmap memBitMap;
memBitMap.CreateCompatibleBitmap( &dcMemory, 400, 400 );
dcMemory.SelectObject(&memBitMap);
PlayEnhMetaFile(dcMemory,*meta_handle,&rect);
m_deviceContext->BitBlt(0,0,rectwidth,rectheight,&dcMemory,0,0,SRCCOPY);
|
|
|
|
|
does PlayEnhMetafile works in OnPaint event without using the memory DC i.e directly drawing on the screen??
is the rect properly set, 400x400 is the dimention of the screen, the rect should fall in that only, i guess 0,0,400,400
|
|
|
|
|
Yes,Its is playing the EMF to screen directly with out memoryDc.
Iam giving a different size in the bitBlt function ,which is the width & height of the EMF fILE
|
|
|
|
|
Give the width n height of the emf file to the CreateCompatibleBitmap.
Then it should work....
Other than this i am out of ideas.
|
|
|
|
|
Okay,I will try that.
Thank You very Much...
|
|
|
|
|
Can anyone tell me something about crystral reports. What is it and from where can i download it?
Recently a project came to me for maintenance purpose. When i try to run it, an error dialog box occured, asking me for a dll related to crystal reports. I heard this name many times before. Please tell me abt it ?
|
|
|
|
|
1. What is it? It's a reporting package, I think, from Seagate Software, although it might have changed owners - see here[^] .
2. You can't download it for nothing, it's a commercial package.
You can't maintain the project if you can't replicate the development environment.
Next!
Steve S
[and yes, I am a little grouchy today, thank you...]
|
|
|
|
|
I have made an application in vc++ that uses flexgrid to show data. I have made this application on NT 2000 but when i run the setup of application on Windows XP then flexgrid is not coming in the application. Can anyone pl. tell me the reason for this.
Thanx in advance for everyone's help
|
|
|
|
|
1. Have you copied the flexgrid OCX onto the XP machine?
2. Have you registered the OCX?
Steve S
|
|
|
|
|
hi,
I have created a wizard (CPropertySheet) using the visual studio property
sheet plug-in.
When my pages are shown on the property sheet they are looking odd.
A margin is being added to the left and the right of the dialog.
Furthermore, the margin on the right is larger than the margin on the left,
making my dialog look mis-aligned.
I am sure that others have seen the same thing because what I am describing
always happens.
Can anyone give me suggestions on how to avoid these margins completely?
Thanks,
Jeremy.
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
Hi all,
Does anyone know how to use IDocHostUIHandler::ShowUI method.
MSDN says :
Called by MSHTML to enable the host to replace MSHTML menus and toolbars..
Can someone explain what this means and how it used in customization of menus and toolbars of IE browser.
Please correct me if I am wrong track.
Thanks in advance,
Abhi Lahare
|
|
|
|
|
|
Hi all,
Is it possible to force processes to release drives/folders which they have locked? The OS is capable of doing this when you try to format a floppy drive that is in use by other people.
Mark
|
|
|
|
|
Hi !
My class is derived from a class which takes in its constructor a pointer to an IODevice.
In my dervied class, I want to initialize this IODevice (open it) before calling the base class constructor.
If I do this in my derived class constructor :
MyClass:MyClass() : BaseClass(&MyIODevice)
{
MyIODevice.open();
}
the base class is called before my dervied class constructor is openning the device.
How can I solve my problem ? How can I delay the base class constructor call?
Thanks !
Jerome
|
|
|
|
|
You are changing the fundamentals of C++, Do post this question to Bjarne Stroustrup
http://www.research.att.com/~bs/homepage.html
|
|
|
|
|
I dont know how to do what you are asking for, but there is one solution though.
instead of deriving the class you can make a member variable of baseclass, then initialise the iodevice and then initialise the baseclass with the device.
Kinda wrapper to the baseclass.
|
|
|
|
|
Hi !
I thought about the wrapper, but then I would have to reimplement in my class each public method of the class I would wrap, and then just forwarding the call to a method from my wrapper to the wrapped class. I wanted to avoid that by subclassing....
Well, I guess there is no other solution !
Thanks for the help !
Jerome
|
|
|
|
|
Your base class does not accept uninitialised device rite, that means the device is first initialised and then passed to the baseclass, you need to do the same with ur derived the class too.
|
|
|
|
|
You should think about inventing language "D"
What if this device wont open? (Big sh*t)
I recommand open it before constructing "Baseclass". Use the F11 button to step in...
Try this @ home. (B&B)
|
|
|
|