|
void CLawMaterialView::OnSelchangeType()
{
m_combo=(CComboBox *)GetDlgItem(IDC_TYPE);
m_eFruitVal = (eEnumeratedFruit)m_combo->GetCurSel();
switch (m_eFruitVal)
{
case 1:eRD;
m_combo1=(CComboBox *)GetDlgItem(IDC_COMBO2);
m_combo1->SetCurSel(0);
m_combo1->ResetContent();
m_combo1->AddString("White ceramic rod BA80");// I want it from databse NOT add one by one.
}
From above code, is it Add a new value after select the 1st combobox, BUT how to have a value in combobox is from database????
Plz advise!
Danny Gan
|
|
|
|
|
sorry but... i don't understand you question...
could you please reformulate much explicitely ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
The switch statement has nothing to do with MFC. It is a C construct.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I met a problem when writing a mfc regular dll. I want to export a funcion which create an object extending from CWnd. To my surprise, there occurs an error when calling the CWnd::createWindow()--return NULL as the window handle , however,it works very well if I directly add the class source in my project.
what should I do? Can anyone help me? Thanks very much!
|
|
|
|
|
You have two choices that work fairly well.
1. Call a function to display the window and all opeations are contained entirely within the DLL - this works well for dialogs, mostly.
2. Create the DLL as an MFC Extension DLL - the application loading the DLL should be an MFC application. Then you can export the entire class and use it within the application just fine.
Anything else is mixing the models MFC was designed for and will result in strange problems now and in the future.
|
|
|
|
|
Hi all,
I have three questions:
1-How to create a function like enumWindows?
2-How to use crystal report 10 in mfc?
3-How can I get the IP address when a client sends a
message to the server app?
regards.
Thanks.
|
|
|
|
|
javad_2005 wrote:
1-How to create a function like enumWindows?
Although less reliable, you could try using GetWindow() in a loop.
javad_2005 wrote:
2-How to use crystal report 10 in mfc?
I believe they have an SDK. Have you looked into that?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Please help me create resource DLL that can contain alpha color icon.
Thank!
|
|
|
|
|
Hi 2 all,
I have an MDI Application, the problem with it is that whenever i open a file registered with my app from the explorer... it creates a new instance of my application. I want to make sure that whenever a file is loaded from windows explorer it is loaded in the previous instance ( if there is any )...
please help asap.
Lid.
|
|
|
|
|
Check out this article, as well as this one.
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
i am currently handling a project using window programming that also support client server technology. in my project, i need to assure when a client click on the menu, the server will do what the client request. i just couldnt figure how to run few client programs that can control the server program. if multiple giving commands at the same time. what will happen. i really have no idea. hope someone can help me.
blurblur kf
|
|
|
|
|
Hi!
is there some kind of events we can use to know when a new process is running?
thanks!
|
|
|
|
|
Can any body give me a how or a sources code to implement a right click function which show a drop down menu on item in ClistCtrl ??
Nobody is Lonely
|
|
|
|
|
catch the Right Button Click on CListCtrl and using TrachPopupMenu api display the Menu on the CListCtrl.
just Check the documentation of TrackPopupMenu in local copy of MSDN it's contain the example for displaying the popupmenu
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
i have add this command from msdn library, but it have some errors...
void CMCSProjectDlg::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CView::OnRButtonDown(nFlags, point);
CMenu* menu_bar = AfxGetMainWnd()->GetMenu();
CMenu* file_menu = menu_bar->GetSubMenu(0);
ASSERT(file_menu);
file_menu->TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x,
point.y, this);
}
ERROR:
error C2248: 'OnRButtonDown' : cannot access protected member declared in class 'CWnd'
: see declaration of 'OnRButtonDown'
: error C2352: 'CWnd::OnRButtonDown' : illegal call of non-static member function
: see declaration of 'OnRButtonDown'
Error executing cl.exe.
What d' problem ??
Nobody is Lonely
|
|
|
|
|
Hello everyone.
I have a dialog attached in a frame, the propery of dialog is "child", in the dialog there are some edit boxs, comboboxs and buttons. When these controls in dialog got focus, I want to catch the active event. I tried to add WM_ACTIVE to dialog, but it can not be called. How to know when the dialog is activated?
Thanks.
-Freehawk
|
|
|
|
|
When these controls in dialog got focus, I want to catch the active event.
for that u can use EN_KILLFOCUS and EN_SETFOCUS events of edit box
|
|
|
|
|
How can I connect to a SQL/MSDE database. I figured I couldn't use CDaoDatabase since it's not an Access database that I want to connect to. Is this the connection I should use?
strConnect = _T("Provider=sqloledb;Data Source=MyServerName;"
"Initial Catalog=MyDatabaseName;"
"User ID=myUsername;Password=myPassword;");
Now how do I use this string to connect and query my database?
Thanks!
|
|
|
|
|
Have you considered using ADO?
|
|
|
|
|
Yes but isn't using ADO in C++ very complex? My program isn't COM-based so it may be a little difficult to implement. Are there other alternatives to using ADO?
|
|
|
|
|
I'm using ADO in my app and to be honest I don't even know what COM is. I didn't find it very difficult, I'm not aware of easier alternatives (but I'm no expert). This article was very helpful to me:
http://www.codeproject.com/database/simpleado.asp[^]
If you have any more questions I'd be glad to help but we should probably move this over to the SQL/ADO/ADO.NET message board.
|
|
|
|
|
Thanks Wilsonian! I'll try it out and if I'm still having problems I'll post it in the SQL/ADO/ADO.NET board. Thanks again!
|
|
|
|
|
Hello,
I'm using the following code to create database programatically, and it works only on WinXP, it crashesh on win98/ME/2000:
CDaoDatabase db;<br />
db.Create(_T("tmp.udb"));<br />
CDaoTableDef TableDef(&db);<br />
TableDef.Create(_T("Addresses"));<br />
TableDef.CreateField(_T("AddressID"), dbLong, 4, dbAutoIncrField);<br />
TableDef.Append();<br />
db.Close();
with error from daocore.cpp -> line:453
What am I doing wrong?
|
|
|
|
|
Im looking for a method of get the effective size of a dinamic array created with the new statement, because the sizeof instruction only gives me the size of the pointer or the size of the first element of the array, maybe that i don't know how use that, but i really want to know the size of an array without having the number of elements of the array, (if it's posibble) the same as UBound property in VB6.
PS: excuse if this text is a little confuse, i'm from argentina and my english is basic.
Thanks
|
|
|
|
|
Either the class that you use to create your dynamic array has member functions to check the size, or it doesn't. What class are you using to create your dynamic array?
|
|
|
|