|
Trollslayer wrote:
I assume the problem is related to the parent value, but any ideas ????
I'm not sure I understand you here...however
If the number of controls required is ambiguous then I would suggest using a dynamic array of controls and calling there Create function.
If your only concerned with dialog boxes and the number of controls required is known you could:
1) Load the control(s) from a resource dynamically
2) Use a static array and call it's Create functions
The first method is probaly easier. I'm not sure from experience standpoint, but i'm thinking you could probably fill the dialog data structures yerself and make the calls to CreateDialogIndirect(). This would allow you to load a custom external file with the controls and positions and create the controls dynamically this way.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
I would like to create a new interface ( not dependent on an object, and not inheriting from IDispatch), how can I do that ?
Thanks, Bye
Braulio
|
|
|
|
|
Don't use the class wizzard.
Make rigth click over the class browser, and select new class....
Sometimes I prefer to add the interface by hand, I define the new interfase in the IDL file, I make a new guiid, and copy the class and rename that. Is easy only you need a little of practice...
Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
Computer Science: solving today's problems tomorrow.
|
|
|
|
|
Thanks,
I will do that !
Bye !
Braulio
|
|
|
|
|
Keep in Touch...
Nos vemos...
OH Bob speak in Spanish....
Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
|
|
|
|
|
Hi,
I'm having massive problems with connection points, UDT's and SAFEARRAYs.
I am trying to wrap my inproc server around an existing component. Unfortunately, it has been design around use with VB and the events that it fires pass data in safearrays. Consequently, in my C++ component I'm having a nightmare getting my event sink to compile. The IDL for the event is decalred thusly...
HRESULT ZoneMessage(
[in] SAFEARRAY(ZoneMeasurementElement)* ZoneArray);
I don't think that there is much I can do about this. But of course, it's documented that the compiler will not know anything about the UDT when it prerocesses the headers...
i.e. this in the header cannot work...
STDMETHOD(ZoneMessage)(
/*[in]*/ SAFEARRAY ZoneMeasurementElement)* ZoneArray);
and this proves to be the case. Now, I've read that states for an [out] parameter you should remove the UDT from the signature for the implementation like so...
STDMETHOD(ZoneMessage)(/*[out]*/ SAFEARRAY** ZoneArray);
But this is the crucial point, this is connection point method and, so I need to declare
STDMETHOD(ZoneMessage)(/*[in]*/ SAFEARRAY* ZoneArray);
This does not work. I've tried endless permutations and failed miserably. The only thing that compiled was to declare the [in] parameter as a VARIANT but that wasn't really getting me anywhere I don't think.
Any help appreciated.
matthew
|
|
|
|
|
Did you try running it with the Variant? Your safe array may be buried inside it. I've never tried this myself, but it seems like it might be worth a try.
Hope this helps,
Bill
|
|
|
|
|
How do you know when an object is going to destruct? Provided you don't implicitly call the destructor. Thanks in advance.
-CDudd
|
|
|
|
|
If you create the object with new the destructor is called as part of the operations performed by delete .
If the object is created on the stack (no new ), the destructor is called when the object goes out of scope (e.g. if it is a local variable inside a function, the destructor is called when the function exits).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
An object is destructed when explicitly delete d or when it goes out of scope, if created on the stack.
An object is also destructed when its containing object (if any) is destructed. This applies to implicitly constructed members of the containing class. Dynamically created members need to be explicitly delete d.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I use this code :
CBrush Red;
Red.CreateSolidBrush(RGB(255,0x00,0x00));
CBrush* savebrush = dc->SelectObject(&Red);
dc->BeginPath();
dc->Ellipse(11*Xunit,10*Yunit,16*Xunit,16*Yunit);
dc->Ellipse(14*Xunit,10*Yunit,19*Xunit,16*Yunit);
dc->MoveTo(8*Xunit,14*Yunit);
dc->LineTo(15*Xunit,20*Yunit);
dc->LineTo(22*Xunit,14*Yunit);
dc->EndPath();
dc->FillPath();
Some parts are painted as white area,but I want all of them to be red.
Any Suggestion?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Check out SetPloyFillMode.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi!
I tried to eject media from my CD-ROM drive ( Z: ) in an MFC program by using Interrupt 21h. But when I run the program, I get an exception in KRNL386.EXE at 0001:00008614 and the program crashes. While bx was 001Ah before the crash as it should be, the "crashing dialog" tells me it is 898Dh after the crash. So what did I do wrong?
void CEjectDlg::OnEject()
{
WORD DriveNum = 26;
BYTE DeviceCat = 0x08;
__asm
{
mov ax, 440Dh
mov bx, DriveNum
mov ch, DeviceCat
mov cl, 49h
int 21h
}
}
Another thing: is there a way to close the drive again by using Interrupt 21h?
Thanks,
Martin
|
|
|
|
|
You probably ought to use DeviceIOControl to eject your device.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
|
I'm looking at this URL
http://www.codeguru.com/opengl/oglwrapperclass.shtml
under the heading - Basic Use
I'm trying to create my own MDI application and draw graphics in the child window. But I don't understand anything about the six steps. i.e. when it says to replace CView with CGLEnabledView, do I just replace the word? Or do I have to actually create the class CGLEnabledView with all the methods and variables. It also tells me to override the VideoMode and OnDrawGL functions. What does that mean? When I create an MDI app, I don't see any such functions in my workspace. Are they present in header files? Basically, could someone give me a more detailed step by step explanation of how to set up an MDI app. where I can draw OpenGL graphics in the child window.
|
|
|
|
|
I have created an AppBar based on a CMDIFrameWnd (Instead
of the typical CDialog implementations.) My problem is
that once the AppBar has been docked to an edge, its
window is subsequently repositioned to fit within the
reduced screen area that was created at the time that the
AppBar was initially positioned. By looking at the values
passed into OnWindowPosChanged() I confirmed that the
AppBar was initially positioned properly, but there is
always one final internal action which repositions the
AppBar window into the reduced screen area. My AppBar
window is being resized in response to its own docking
notification! I am sure that this is an artifact of using
CMDIFrameWnd, but I do not know how to work around it.
Does anyone have a suggestion for how to prevent the
automatic resizing?
Thanks
|
|
|
|
|
I have a paint program....
I want to save what i have drawn to the Screen DC(the lines, rectangles, etc.) to a bitmap...
What i tried to do was to select a bitmap to the screen DC (CDC::SelectObject()) and then copy it to a memory DC (CDC::Bitblt).... it seems its wrong....
How do i go about it??
|
|
|
|
|
The screen DC has a bitmap in it, you need to select a bitmap into a memory DC, and then BitBlt.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
Hi,
I have made an interface for setting and retrieving metafiles, and I would like to make like in ATL, I want to have:
IMyInterface
and
IMyInterfaceImpl
But I don´t know exactly how to do this or if it is a good idea ( I´m using ATL), can you help me ?, Thanks, Bye !
Braulio
|
|
|
|
|
Perhaps anyone has code available how to turn a bitmap (CBitmap or already drawn onto a CDC) into grey?
So far I tried to set a greyscale palette onto the CDC, but it did not work. And repainting every pixel is much too slow.
Any ideas?
Thanks in advance,
Roland
|
|
|
|
|
You're stuck. You NEED to do this pixel by pixel. It's much faster if you use a DIBSection, which is a DIB, but can be selected into a DC for drawing like a CBitmap. By the way, the formula is not red + green + blue/3, it's weighted if you want it to be right. I forget the weightings right now, but I've given them in this forum before, so do a search and you should be right.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
We are using Visual sourcesafe to share our code.
Our software is build around a central library. This library ( a project in vss) is shared to other Projects.
We want to create a new version of this library. So it must be possible for the client projects to use shared code from only 1 library.
But how can you verify what the source is of a shared file in vss?
From the icon, it is possible to see it is a shared file, but you can't see his location.
Any Ideas on this concept ?
|
|
|
|
|
Look at the properties of the file.
NikoTanghe wrote:
Any Ideas on this concept
Read the documentation
|
|
|
|
|
Mark Nischalke wrote:
Look at the properties of the file.
The properties of a shared file only show the current project, not the library ( = project) that shares the file !
Mark Nischalke wrote:
Any Ideas on this concept
Read the documentation
The manual doesn't help me solve my problem
|
|
|
|