|
|
right click on the edit box -> take style tab
There u can find the a check box named Number
nave
|
|
|
|
|
on the resource editor, there is a "decimal" property which make the editBox accept only the 10 decimal digits...
if you'd like to allow the . character, or a sign character like + or - , you'll have to overload the WM_CHAR event...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Hello i have a menu resource that i want to attach to a Window and i don't know how to do it
Thank you very much for your help
A C++ illiterate...
|
|
|
|
|
First Load menu resource using LoadMenu(...)
Second Set menu for the frame using SetMenu(...)
For eg:
CFrameWnd *pFrameWnd = (CFrameWnd *)AfxGetMainWnd();
CMenu cmenu;
cmenu.LoadMenu(IDR_MYMENU_RESOURCE)
pFrameWnd->SetMenu(&cmenu);
pFrameWnd->DrawMenuBar(); Nibu thomas
Software Developer
|
|
|
|
|
|
Mahhouraaaaaa wrote: dlg.SetMenu(&Menuone.m_hMenu);
dlg.SetMenu(&Menuone);
Nibu thomas
Software Developer
|
|
|
|
|
CTest1Dlg dlg;
CMenu Mymenu;
Mymenu.LoadMenu(IDR_MENU1);
dlg.SetMenu(&Mymenu);
dlg.DrawMenuBar();
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
//------------- Blablabla
this code is located in the main class of the program so that it shows NO ERRORS ..and NO MENU ... i'm sorry for buggin' you but i need help thank you
-- modified at 4:30 Tuesday 28th February, 2006
|
|
|
|
|
Mahhouraaaaaa wrote: CMenu Mymenu;
Mymenu.LoadMenu(IDR_MENU1);
dlg.SetMenu(&Mymenu);
dlg.DrawMenuBar();
Transfer the above code to OnInitDialog .
Nibu thomas
Software Developer
|
|
|
|
|
on the resource design editor, open your dialog/frame and check its properties ; you'll find a "menu " option... there, change it for you IDR_MYMENU
please, don't leave it as IDR_MENU1 as the wizard autogenerate ; give it a more significant name
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Thank you Nobi thomas and thank you txcct
Thank you very much
as i said i don't know anythin' in C++ :> :p
|
|
|
|
|
i call "waveinopen" when another program using sound blaster, it can work ok on winxp,but can not work on w2k ,it returns MMSYSERR_ALLOCATED ,why?
and what can i do?
thanks!
|
|
|
|
|
|
hi, I am student and am actually doing a project on landscape generator... its quite tough.. my problem is that am nt being able to load a bitmap image from files to my picture box when the user click on a specific button.. plz help me...
|
|
|
|
|
Try the code below
HBITMAP hBitmap = (HBITMAP)LoadImage( 0, csFileName,IMAGE_BITMAP,
100,80,LR_LOADFROMFILE );
// m_static is the control variable for the picture box
m_static.SetBitmap( hBitmap );
nave
|
|
|
|
|
#include <atlimage.h>
...
...
CImage m_image;
m_image.Load(m_FileName);//For Load Graphic Files
then
if draw Picture inthe Screen you use Event WM_PAINT and function BitBlt
For Static Control //CStatic
SetBitmap
else
for Buttons
you need OWNERDRAW in the property butoon
then
SetBitmap
You use CbitmapButton
else
For ListCtrl
you should use CImageList
else
in the Site CodeProject Directory Bitmap is good
,......
Have a nice day
-- modified at 3:05 Tuesday 28th February, 2006
|
|
|
|
|
Here's one way (I assume you want to load from a file):
1. Add a picture control to the dialog, be sure to set its type to "bitmap". Change to ID to something meaningful.
2. Using the ClassWizard add a member variable of type CStatic for the control, call it m_Picture .
3. Add the following to your class declaration:
HBITMAP m_hBM;
4. Add the following code to the dialog's OnInitDialog handler:
HBITMAP m_hBM = reinterpret_cast<HBITMAP>(
LoadImage(
NULL,
_T("C:\\130x130.bmp"),
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE
)
);
m_Picture.SetBitmap(m_hBM);
5. Add the following in a WM_DESTROY handler:
DeleteObject(m_hBM);
Steve
Steve
|
|
|
|
|
Hi Guys,
In "File View" of my visual studio's work space when i "Right Click->Add Files to Folder" its giving me one error like "Microsoft Developer(R) Studio has encounted a problem and you need to close it..............." When i am closing it then its not even closing rather the hour glass comes and it's taking too much time. For your information i am working on a visual c++ project.I will appreciate if any one can tell what is the cause and how to fix it.
|
|
|
|
|
This seems to be a application bug. Try this: open the file in your Visual Studio and rightclick in the file window. There is also a menuitem 'Add to project' (or similar). If this doesn't work you have possible to reinstall your DevStudio.
|
|
|
|
|
Thanks a lot. Have a nice day.
|
|
|
|
|
I want to use my exe (installed in someone's computor) to forbid someone printing by his local printer or network printer!
how to implement?
thanks
|
|
|
|
|
Hi,
I have an MFC application in which I take records from a table in one database (Let's say database A, table A), and insert them into a table in another database (Let's say database B, table B). This is a sort of "database conversion".
The thing is, that in database A the record numbers are not necessarily consecutive (for instance there could be records #1,2 and 4), But in database B the records are inserted to table B with an automatic record number.
For instance:
Table A (Database A) Table B (Database B)
-------------------- --------------------
record #1 ------------> record #1
record #2 ------------> record #2
record #4 ------------> record #3
My problem is that I need to save the record numbers of the records in database/table A, in order to use them later (for database relationship purposes).
(For instance - i need to know that record #3 in database B was actually record #4 in database A).
I used a CArray object to keep the indexes of the records of database/table A, but after I do the "database conversion" I need to use the indexes (of database A) in another application. how can I do this?
By the way, I am using C++ (and MFC) in .Net 2003.
|
|
|
|
|
May be you can add an extra field in the table in database B to save the index?
|
|
|
|
|
yeah - that's the solution I wanted to avoid..
|
|
|
|
|
Can you not turn off the "auto increment" property of the one column in table B, and just make it a number-type column?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|