|
Right so long so good, but how do I know where the focus vil go. If the user close the dialog or exit or switch to some other program, then I dont want to validate.
|
|
|
|
|
If the user dismisses the dialog, or switches to some other window, you don't need to validate any of the controls. The OK button should not be enabled until each control contains valid data.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
JGranborg wrote:
Validating control content when loosing focus
Be careful If two fields depend on each other, you can get into an infinite loop where the user can't leave the field they're editing. I've experienced this before and it's very frustrating
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
just a simple q
in the printf() function, if we use %E or %e, the output is in scientific notaion
e.g. 2.11E+002
now i wanna ask how can i change it into the form 2.11E2, without + sign and leading zero.
thx
|
|
|
|
|
jooo wrote:
...how can i change it into the form 2.11E2, without + sign and leading zero.
You would have to parse it yourself.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I've been trying to research a solution to this issue for the past week but havent found anything substantial. If anybody has a suggestion/solution I would greatly appreciate it.
Scenario:
I have a large number of popup dialog box pre-created and used in an MDI application. Now the objective is to move to tabular and splitter views. I want to somehow convert these dialogs into CFormView objects so that they can be displayed in a view of the splitter pane. What I want to do is basically, get all the dialogs, process them through a particular class that will convert them into CFormView objects and then display them in a Splitter Pane.
If anybody can help me I would really appreciate it.
A
|
|
|
|
|
One solution is MoveWindow().
Kuphryn
|
|
|
|
|
The problem is not repositioning the Windows, but since an object of CDialog cannot be displayed in View, it gives an error when we load a dialog. I wanted to know a way to convert the CDialog to CFormView.
A
|
|
|
|
|
Hi everybody, I'm trying to compile a a C++ application with MS Visual Studio .NET 2003 Architect.
First I compiled a library (.lib), then I used this lib to develop an application.
During the linking operation I obtain this error message:
libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in geardebug.lib(text.obj)
(where text.obj is part of the lib I developed)
Can anybody help me to understand why this happens?
Thank you very much
|
|
|
|
|
there's a setting somewhere in your project settings where you can choose to ignore certain libraries; try that. Sorry, I'm not exactly sure where it is, but I've used it before, so I'm sure you can find it.
[insert witty comment here]
bdiamond
|
|
|
|
|
hi,
i 've got a toolbar with a Combobox and 4 Buttons (pushbuttons), where i can (de)activate the combobox, whenever i want. I think it's easy possible, because in the CToolBar- derived class i 've got a handling member for this box, but even no member for one button.
So i added a CButton- member to the CToolBar- derived class to fit this problem and to (de)activate one button at same time, the combobox is (de)activated.
But it does'n t work :-/
Can anybody help me ?
thanks,
Aqua
|
|
|
|
|
I'm running Visual C++ .Net and have run into a problem when trying to open a file directly off of a CD-ROM or DVD drive. The files in question have no "last accessed time" which causes the program to return an error. For my purpose, I don't need to know if the file has ever been accessed, but I cannot seem to move past it without it returning an error. I have thought about temporarily moving the files to a harddrive first, however, some of these files can be anywhere from 400 megs to 2 gigs and things are time-critical.
right now, it blows out in line 130 of "filest.cpp" with the following line:
rStatus.m_atime = CTime(ftAccess);
anybody know how to get around this? Thanks for any and all help!
TerpZebra
|
|
|
|
|
This is a known issue. See these two links for more:
http://groups.google.com/groups?q=ctime+cd+accessed&hl=en&lr=&group=microsoft.public.vc.mfc.*&selm=Jsu%241IcNDHA.1616%40cpmsftngxa06.phx.gbl&rnum=1
http://groups.google.com/groups?hl=en&lr=&frame=right&th=1648a425c6453813&seekm=086101c3ba5d%24a0518dd0%24a501280a%40phx.gbl#link1
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi Guys,
I have a Dialog Resource in my resourceEditor & I have created a class out of it say "C_TestDialog",which is derived from CDialog.
I want to place a Toolbar control in this dialog. So I have added a "ToolBarcontrol" also in my resourceEditor.
Now If I take my ClassWizard,& select the "C_TestDialog" under class name.In the "ObjectIDs" section I see my classname & in the Messages column,I see all of the events,messages etc of this class.
Now What I need now is,How can I include my "toolbarcontrol" also inside the ObjectIDs section,under the className "C_TestDialog",so that I can see all the messages related to the toolbar control.
RightNow,If I select my toolBarcontrol(IDR_SelectToolBar) inside the ObjectIDs section,I see only 2 messages - "COMMAND" & "UPDATE_COMMAND_UI".
Iam creating my toolbar as follows:
CRect toolbarSize(20,20,300,50);
//m_toolBarCtrl is the member varibale of type C_ToolBarCtrl--
which is a member of C_TestDialog class.
m_toolBarCtrl.Create(WS_CHILD|TBSTYLE_FLAT,toolbarSize,this,IDR_SelectToolBar);
m_toolBarCtrl.AddBitmap(1,IDB_BITMAP1);
TBBUTTON tb[2];
// Index of new button image.
tb[0].iBitmap = 0;
// Setting button state
tb[0].fsState = TBSTATE_ENABLED;
// Setting button style
tb[0].fsStyle = TBSTYLE_BUTTON;
tb[0].dwData = 0;
tb[0].iString = NULL;
m_toolBarCtrl.AddButtons(1,tb);
m_toolBarCtrl.ShowWindow(true);
Note:
Don't want to create a class derived from CToolBarCtrl.Want to access the Messages of the "toolbar" from my C_TestDialogClass.(For eg.- when the user clicks on the toolbar at runtime,I want this event to be trapped inside my C_TestDialog class)
Any Help is appreciated.
Thanks...
|
|
|
|
|
with the help of a c++ 6 control i get hotkey information in the form of a DWORD (it may be f.e. ctrl+s)
DWORD CHotKeyCtrl.GetHotKey();
how to extract information so that this DWORD is comparable to a WPARAM
in the message queue, if a key is pressed i get a WPARAM with information in it about the key being pressed
I just want to know how to compare the dword to the wparam
(HIWORD? LOWORD? <- i am a prog-n00b plz easy language)
|
|
|
|
|
To extract information from the return value of CHotKeyCtrl.GetHotKey() use HIWORD and LOWORD macros.
wVirtualKeyCode=LOWORD(GetHotKey());<br />
wModifiers=HIWORD(GetHotKey());
To create WPARAM use MAKEWPARAM macro: MAKEWPARAM(wVirtualKeyCode,wModifiers)
To compare DWORD to WPARAM use: if(wParam==(WPARAM)dwValue)
Regards,
Andrzej Markowski
|
|
|
|
|
Can anyone tell me how I can change the value of $(TargetPath)?
"Live long and prosper." - Spock
|
|
|
|
|
I think that's the output for a particular file you're building. For .cpp/.c etc I don't think you have a lot of choice. For the exe/dll etc, I think it's whatever you specify in the output for the linker settings.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
For MANY of the project files:
Go to Project Menu, Settings Menu Item, Project Settings General Tab, change OUTPUT FILES destination folder.
If you just want EXE to go somewhere else:
Go to Project Menu, Settings Menu Item, Project Settings Link Tab, Category General, change path for OUTPUT FILE NAME.
|
|
|
|
|
I want to display a menu when ever a button is to be clicked .Please help me
Thx
Learner always
|
|
|
|
|
|
Thank You very much ravi
Learner always
|
|
|
|
|
Hello All,
I have a requirement in vc++ wherein i have to connect to sql server on a remote
machine(having static IP address), how do i connect to the machine in vc++6.0 and start doing
transactions?
We have 'SqlConnection' class in .NET , so anything similar to that in vc++ ???
please send the code if possible.
Thanks,
Prax
|
|
|
|
|
struct GroupConstant
{
CString** grpConst;
};
GroupConstant** m_pGrpConst;
m_pGrpConst = new GroupConstant*[200];
for(BYTE i=0 ; i<200 ; i++)
m_pGrpConst[i] = new GroupConstant[50];
CString** pstr = new CString*[4];
for(BYTE i=0 ; i<4 ; i++)
pstr[i] = new CString[2];
GroupConstant** ppTemp = m_pGrpConst;
GroupConstant* pTemp = (*m_pGrpConst);
for(i=0 ; i<200 ; i++)
{
for(BYTE j=0 ; j<50 ; j++)
{
(*m_pGrpConst)->grpConst = pstr;
(*m_pGrpConst)++;
}
(*m_pGrpConst) = pTemp;
}
m_pGrpConst = ppTemp;
I have two double pointers. one is a content of the structure and other is pointer to the structure.
I initiate these double pointers as you see in the code. but now I have a problem with deleting these pointes.
how can I delete the double pointer included with structure and double pointer points to structur.
Thank you in advance.
|
|
|
|
|
Example with the m_pGrpConst pointer:
First delete all the pointers inside the structure:
for (int i=0;i<200;i++)
delete[] m_pGrpConst[i];
Then delete the pointers that point to these desallocated pointers:
delete[] m_pGrpConst;
|
|
|
|