|
I have ever thought, that exported functions cannot return a struct or class. Try to pass the return value by pointer: void f1(SomeStruct1 *pS, SomeStruct1 *pReturn);
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
Is it possible to lock toolbars in place, a bit like what IE is doing when checking the "lock the toolbars" in the view mene, without having to chant incantations and lighting incense to the god of win32 API ?
I think that I need to change the style, and maybe have to remove the gripper.
Any info ?
Thanks ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
If this is an MFC application, not calling EnableDocking() and DockControlBar() in the mainframe's OnCreate() method will keep the toolbar from docking (i.e., locked).
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
How do you permit scientific notation to be accepted in an edit box? Currently, I have it set to accept a float, but need it to accept scientific notation. Then I will need to pass this value to a register on a PCI board.
Thanks for any assistance.
Walt
|
|
|
|
|
Walt_S wrote:
How do you permit scientific notation to be accepted in an edit box? Currently, I have it set to accept a float, but need it to accept scientific notation.
By default, an edit box can accept any charcter that can be typed, and most that can be pasted. If you are wanting to limit the input to only scientific characterfs, you'll need a formatted edit control. Check here for ideas.
Walt_S wrote:
Then I will need to pass this value to a register on a PCI board.
What format (e.g., long, double, char) is the register expecting the number in?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
The register is expecting a double.
Thank you for the info.
Walt
|
|
|
|
|
Hello people,
I have an MDI application, and i want to change the menu of the child frames.....but the GetMenu command gives me the pointer to the Menu of the Main Frame.....on the other hand i want to change the Menu of My childFrames ...please help ...tell me how to access it..and then modify it ...thank you..
|
|
|
|
|
From MSDN Library:
An MDI child window does not have a menu bar of its own, but instead shares the menu of the MDI frame window. The framework automatically changes the MDI frame menu to represent the currently active MDI child window.
This explicitly states that by using base-MFC, you cannot have a MDI Child window with a real menu bar, but the menu associated with the child window is automatically replacing the frame window's menu when you give focus to a child frame.
You need to rebuild some basic functionality automatically provided to you by the framework if you want to achieve a child frame with a menu. Firstly, you need to derive a new class from CFrameWnd. This will be your child frame class. Give it a ON_WM_CREATE handler and force it to load a menu by explicitly creating a CMenu object and calling CWnd::SetMenu. Frame windows support menus, so the call is valid. After this, you need to create a view and bind it to the child frame.
Lastly, you must create a handler for command ID_FILE_NEW on your parent frame window. Here, you must manually create a child frame window and show it.
In order to get you into a good start, create a new MDI project and remove the tick 'Doc/View arhitecture'. Examining the generated code gives you an idea of the processes required to create non-doc/view MDI applications.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Ok first of thanks for answering my question. You said that MDI child doesnt have its own menu but the framework automatically changes MDi frame to represent the active MDI child window...hmm well ok...
I dont want to create a menu for the child window then , all i want to do is to be able to make changes to it..how to do that...actually i want to add a feature to my menu that it displays all the currently open documents in the menu(i know this thing is already built in when u make the MDi or SDI app, but i want to make my own.
To do this i need to be able to change the menu that is displayed when child is active...plz help me with this thank you..
|
|
|
|
|
As the framework alters the frame window's menu when a child gets activated, it is possible to access this menu through the CWnd::GetMenu routine. Then, you can alter the menu using CMenu operations. Although the menu resides on the parent frame's menu bar, nothing prevents you from altering it in the standard way. If you want to be certain, call GetMenu for the child frame. This, for certain, should return the child frame's menu that is currently visible on the parent frame's menu bar.
Furthermore, when a child window is activated (it's title bar is clicked), a Windows message WM_MDIACTIVATE is generated and sent to the frame that is being activated as well as to the frame that is being deactivated. That is, two messages in total. For the child frame class, the default handler of CMDIFrameWnd answers to this message by modifying the parent's menu. You could add to this, by first calling the base class (to modify the menu), then use CWnd::GetMenu to return the menu and do additional modifications to it.
This way, you would only need to write the basic layout of the menu as a resource, then modify it on-the-fly as required.
There is a function called OnMDIActivate implemented in the CWnd class. If I remember correctly, the same function is declared in the header file that defined CMDIChildWnd , and it is declared virtual in there. If this is correct, you can override it straight through in your derived class to implement the above idea. I am not completely sure whether this approach will work, but it's at least something concrete you could try.
Naturally, everytime the designated child frame is active, you can use CWnd::GetMenu to modify the currently active menu, thus adding the list of currently open documents. However, I am not certain if these changes last over frame deactivation/re-activation..
Hope this will help..
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hello,
I've encountered a strange behaviour of a toolbar (using CToolBar). I add programatically buttons to it from a modal dialog. The strange part is, that when I call RecalcLayout, the toolbar resizes (adds the buttons) but does not display correctly the associated bitmaps and does not manage their state immediatelly. If i manually flow or dock the toolbar, I get the command handling (i.e. the bitmaps appear correctly, and the buttons are clickable and not disabled). If I don't manually dock or flow the toolbar, I get only a resized toolbar without any bitmaps and with disabled buttons. My question here is, what am I missing, and what am I doing wrong.
Greetings,
Deian
|
|
|
|
|
You have to programmatically dock and re-float the toolbar to get it to accept changes in size; at least that has been my experience.
|
|
|
|
|
Thanks for the idea, I've tried this, but I'm making changes from a modal dialog, which is called by the frame. If I try to dock and refloat the toolbar it crashes. May be making the dialog no-modal will work fine, or will have to handle this after the dialog is closed. It's not a clean solution
Thanks for your time!
|
|
|
|
|
GDI+ looks good, sounds good, smells good, but how can i have it on my VS ver 6.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Simple. Get a recent (Feb 03 or Jan 04) Platform SDK, and the GDIPLUS redistributable (unless you're running XP).
Make sure that the platform SDK headers are included before VC6 ones, same for libs and bins (although you'll need to rename the profiling executables in the SDK) and that should do it.
Steve S
|
|
|
|
|
humm, thanx for the help, well you may also say that i should migrate to VS.NET but dont know why i dont want to give up VS6.0
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Hello group,
Currently I am trying to print icons (via printer) using DrawIcon function, but they never appear in the printed document.
Could anybody tell me if there is something wrong in using that function to print icons?
Or even better, can anybody give me a piece of advice to do this task.
TAI.
Julio Garvía Honrado.
|
|
|
|
|
Hello all
How do one can detect whether a particular port is a serial port or virtual com port created for bluetooth? In the case of win2000 and winXP under
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
ports are listed as
/device/serial0 // serial port
/device/Btport1 // bluetooth virtual com port
So in the case of win2000 and winXP, I've no problem in distinguishing a serial port from virtual bluetooth port. But in the case of win98 and winMe
all the ports are listed as
COM1
COM2 .. and so on.
so how do I make an application to recognize bluetooth ports on all the windows platforms? If anyone know how to do it please help me.
many thanks for your help.
Hari.
|
|
|
|
|
Hello all,
I don't know if this is the correct forum for this question (if it is not, I apologise in advance )
I just started to use VC6 (sp5) on a XP pro machine (with all the updates). The problem that I'm having is that while debugging an application, VC6 says the app has exited while I still have the application opened . Because of this, it is very hard to debug the application, as the breakpoints that are simply ignored because VC thinks the app has ended.
Has anyone seen this problem before? I've searched MSDN but was unable to find any clue as to why this is happening.
Thanks in advance
|
|
|
|
|
Hello,
i've got a list view control, which i want to fill with bitmaps that are drawn dynamicly in runtime.
My code is:
CDC *pDC = new CDC();
pDC->CreateCompatibleDC(GetDC());
CBitmap bitmap, *old;
bitmap.CreateCompatibleBitmap(pDC, 64, 64);
old = pDC->SelectObject(&bitmap);
CBrush brush;
brush.CreateSolidBrush(RGB(255, 0, 45));
pDC->SelectObject(&brush);
pDC->Rectangle(0, 0, 64, 64);
m_imageList->Add(&bitmap, RGB(255, 255, 255));
m_ctrlImageList.SetImageList(m_imageList, LVSIL_NORMAL);
m_ctrlImageList.InsertItem(0, "TEST", 0);
------------------------------------------------------
CListViwe m_ctrlImageList
CImageList m_imageList
------------------------------------------------------
It is adding an item to the list but the icon is not proper.
Any suggestions?
|
|
|
|
|
Are any of the functions returning an "error" value? Has CImageList::Create() (or equivalent) been called?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes, SetImageList method is returning 0,
and i'm creating image list with:
m_imageList->Create(64, 64, ILC_COLOR24, 0, 4);
If i use a resource bitmaps the list is working fine, but i want to draw the bitamps.
|
|
|
|
|
status wrote:
Yes, SetImageList method is returning 0,
Which is probably fine. A NULL value would indicate there was no other image list to return.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
So where is the problem then.
|
|
|
|
|
Hi,
(I'm new to this list, so pardon me if I'm asking something already covered. I've looked through everything I can find on this site and several others and can't seem to find the answer.)
Here's the problem:
I need to emulate a User Interface on a new product, in order to make a 'remote control'. It has to look and feel as much as possible like the real thing, which is to say it has a knob and a 3 toggle switches.
To implement the switches (and also the knob) I'm thinking about using a spin control without a buddy window. I've sub classed the control, and draw (stretchblt) a bit map of the switch in it's up, down or middle positions accordingly.
This works great for a horizontal switch (left, right and middle), but a vertical switch has the problem that the slider control's width, (like any scrollbar derived control it seems) has a width set by the system (it appears to be based on the Font size in the 'Appearance' menu for the Display Properties).
I need to be able to set the width, in order to get the full width of my bitmap to appear and also in order to make a larger 'sweet spot' for the user to click on.
How can I override the default width of a sub classed Spin Button, or Scroll Bar, etc?
Thanks,
John Miramonti
John Miramonti
|
|
|
|
|