|
I Am working on a win2000 pro and i want my app to the same interface as of the win xp luna theme what can i do to give my app the look of xp theme.
i have seen some programs which have the same look and feel as the xp theme wheter they are on xp ,2000, 9x, or me
|
|
|
|
|
When it doubt consult MSDN[^]
|
|
|
|
|
I have a MFC Dialog application, but now I would like to create and display an identical dialog, but with different initialisation when its created.
I thought I could use pointers to share/modife data between the displays I think thats OK.
But if I use the following to create the new dialog (in at the bottom of the dialogs OnInitDialog routine):-
g_pIDU[0] = this;
g_pIDU[1] = new CIDU_Dlg(this);
g_pIDU[1]->Create(CIDU_Dlg::IDD, GetDesktopWindow());
g_pIDU[1]->ShowWindow(SW_SHOW);
I am in a loop as never reach ShowWindow as go back into the OnInitDialog routine (which is the Main dialog initialisation).
Also problem with the InitNextDlg hence it commented out!
I dont want to add another dialog (and all the code/resources etc) to my solution as a copy of the main dialog is what I want, but is that the only way?
Any suggestions please.
|
|
|
|
|
where you call your dialog, you create a CmyDialog (for example) object before the dialog is displayed (DoModal() or Create() ).
You could make a specific constructor that receive the specific datas to initialize the dialog with. you should also have data members to store the constructor parameters, because you cannot do what you do in OnInitDialog() in the constructor (The dialog don't exist yet). Then, OnInitDialog() will be able to read the data members and create the dialog consequently.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Sorry I dont understand what you are saying.
I declare an array of pointers to the dialogs:-
CIDUDlg g_pIDU[4]; Then in the OnInitDialog()
of the main dialog I set the first pointer:-
g_pIDU[0] = this;
So how and where do I create the second dialog and then set the pointer:-
g_pIDU[1] = ???;
sweep123
|
|
|
|
|
This is speculation - something to try if you get desperate
I think the problem here MIGHT be that you can not get the Create to work from within the OnInitDialog of the first dialog. Sometimes Windows has limitations of what functions are permitted while others are executing. So... You can post your FIRST dialog a special message to create the secondary dialogs. When the first dialog processes the message, it will no longer be within the OnInitDialog handler, and the other dialogs might create just fine.
Otherwise, I can't see anything inherently wrong with what you are doing, given that you can create child controls within an OnInitDialog call, so it might have something specifically to do with Createing the other dialogs. Or else thee is more to the problem not revealed by your code snippets.
|
|
|
|
|
ok, let's say the datas to pass to the dialog are a bool , a CString , and int .
then, you create a specific constructor :
CmyDialog::CmyDialog (<font color=#0000FF>bool </font>bFlag, CString strTitle, <font color=#0000FF>int </font>iSize)
: CDialog(CmyDialog::IDD),
m_bFlag(bFlag),
m_strTitle(strTitle),
m_iSize(iSize) {
}
of course, you had previously added the correct members to your class :
<font color=#0000FF>class </font>CmyDialog : <font color=#0000FF>public </font>CDialog {
<font color=#008000>
<font color=#0000FF>protected</font>:
<font color=#0000FF>bool </font>m_bFlag;
CString m_strTitle;
<font color=#0000FF>int </font>m_iSize;
<font color=#008000>
</font>};
then, you can call you function, let's say, when "Open" Button is clicked on the first dialog :
<font color=#0000FF>void </font>CDialog1::OnSClickOpenBtn() {
<font color=#0000FF>bool </font>b = 0;
CString str = <font color=#808080>"This is the title of my dialog"</font>;
<font color=#0000FF>int </font>iSz = 5;
CmyDialog dlg(b, str, iSz); <font color=#008000>
</font> dlg.DoModal(); <font color=#008000>
</font>}
the last thing you have to implement in you code is the following :
BOOL CmyDialog::OnInitDialog() {
<font color=#0000FF>this</font>->SetWindowText(m_strTitle);
<font color=#0000FF>if </font>(m_bFlag) {
<font color=#008000>
}
<font color=#008000>
</font> <font color=#0000FF>return </font>TRUE;
}
hope you understand better now
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I new in MFC
I need to send Byte Array from VB to MFC
how to write the function
and what to write in the myfile.h
i also need to impelment the odl file
HELP ME.
thanks Pini
|
|
|
|
|
I am trying to add a "C" file to a C++ program. I get
"fatal error C1010: unexpected end of file while looking for precompiled header directive"
and it will not compile. How do I get around this problem. Conversion to C++ will be very difficult to complete.
Keck
|
|
|
|
|
disable precompiled headers with the VC++ settings > Debug, don't use precompiled Headers.
this error has no relationship with convert C to C++.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You can disable precompiled headers for SPECIFIC source files wihtin your project, leaving the C++ files to continue to use the precompiled headers They don't have to be disabled for the entire project just because you added one o rmore C files to an otherwise perfect C++ project.
Just expand the project tree so that youc an see the source files, right click on the C source files, and adjust the precompiled header settings for that specific file.
|
|
|
|
|
Hi!
I want to add manage extension to my exiting c++ MFC application.
and I found the following link but I couldn't find Compile As Manage property at all.
I chose YES for Use Manage Extension in General property of Configure Properties Folder.
How can add manage extension to my exiting c++ dialog based application so I can use System, System::Text, and other System properties?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vcconaddingmctoexistingapplication.asp[^]
Right now.. even I add
<br />
using namespace System;<br />
using namespace System::Text;<br />
<br />
...<br />
...<br />
Text t;<br />
and the error is Text is not a namespace. I dont 'know why.
Thank you.
|
|
|
|
|
i define a object from one of my own class in CMainframe, then i wanna get a pointer to this CMainframe inside the object, how can i do that?
ps.my own class is derived from CDocument
Josephvan thanks for your attention
|
|
|
|
|
josephvan wrote:
...i wanna get a pointer to this CMainframe...
How about AfxGetMainWnd() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanks, it i'll try it
Josephvan thanks for your attention
|
|
|
|
|
I may have posted this earlier... Anyway... this was written in Borland Builder. This code was written in c++ language. I'm trying to clarify on what's going on. I"m trying to send the message text to the printer. This code did work in Win98. BTW, is there any Borland c++ anywhere in the 'net? The Bynamic-c website is no longer there.
<br />
<br />
#include <vcl.h><br />
#pragma hdrstop<br />
<br />
#include "labeltest.h"<br />
#include <windows.h><br />
#include <time.h><br />
#pragma package(smart_init)<br />
#pragma resource "*.dfm"<br />
TLabel_Test *Label_Test;<br />
__fastcall TLabel_Test::TLabel_Test(TComponent* Owner)<br />
: TForm(Owner)<br />
{<br />
}<br />
<br />
void __fastcall TLabel_Test::btnPrintClick(TObject *Sender)<br />
{<br />
<br />
DWORD numsent;<br />
OVERLAPPED overlapped;<br />
char LabelString[500];<br />
char *Port = "LPT3";<br />
strcpy(LabelString, "A");<br />
strcat(LabelString, "Print Count > 25000 *");<br />
strcat(LabelString, "Q1Z");<br />
Retry:<br />
HANDLE hCom =<br />
CreateFile(Port,GENERIC_READ|GENERIC_WRITE,NULL,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL);<br />
if(hCom == INVALID_HANDLE_VALUE)<br />
{<br />
edtStatus->Text = "Error. Printer Offline";<br />
return;<br />
}<br />
WriteFile(hCom, LabelString, strlen(LabelString), &numsent, &overlapped);<br />
WaitForSingleObject(overlapped.hEvent, 1000);<br />
GetOverlappedResult(hCom, &overlapped, &numsent, FALSE);<br />
CloseHandle(hCom);<br />
if(numsent < strlen(LabelString))<br />
{<br />
edtStatus->Text = "Error. Printer Offline";<br />
return;<br />
}<br />
}
|
|
|
|
|
i have a win32 app - it runs at background, no any user interface such as dialogs or windows.
the size of the app is very important, but it is almost up to 60K, i need to make it much smaller - do you have comments for me?
thx
includeh10
|
|
|
|
|
are you sure because I have an application with a lot of dialogs (4) and also a large code and it only has 112 KB (114.688 bytes). Are you sure you compiled it in release mode ?
The thing is that there is a program (i don't kn ow its name right now) that makes your exe's 200% smaller.
Good luck
gabby
|
|
|
|
|
UPX does that, for example
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Read this article to make sure you understand what you are asking.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
the program will be up-loaded and down-loaded very often.
includeh10
|
|
|
|
|
Hi,
I have a problem with sorting duplicate items in a treeview.
I retrive some info from a database and the resultset look something like this :
Date....|City.....|Code
---------------------------
20041012|London...|123
20041012|London...|456
20041012|New York.|763
20041013|Boston...|236
20041013|London...|983
20041012|Oslo.....|923
And I want the treeview to look like this :
+20041012
...+London
......+123
......+456
...+New York
......+763
...+Oslo
......+923
+20041013
...+Boston
......+236
...+London
......+983
How can i put the correct nodes in the correct level and do this in a easy way?
Tune In, Turn On, Drop Out
|
|
|
|
|
tree-view has a sorting function, it is good enough for your case.
includeh10
|
|
|
|
|
HTREEITEM htiParent = m_pTreeCtrl->InsertItem (strTreeItems[0]);
HTREEITEM htiChild; // child item
htiChild = m_pTreeCtrl->InsertItem (strTreeItems[1], 1, 1, htiParent, TVI_LAST);
m_pTreeCtrl->SetItemState (htiChild, TVIS_BOLD, TVIS_BOLD);
// add the children of the parent item
for (int i = 1; i < 4; i++) {
m_pTreeCtrl->InsertItem (strTreeItems[2], 2, 3, htiChild, TVI_LAST);
}
the code works as you wish, strTreeItems[x] is the Itemtext, that's looks like
+strTreeItems[0]
++strTreeItems[1]
+++strTreeItems[2]
+++strTreeItems[2]
+++strTreeItems[2]
+++strTreeItems[2]
you can do it yourself i think~~~~~~~~~enjoy
cheer up!!!!!
|
|
|
|
|
I want to invoke ON_BN_CLICKED event of a button named bn_test manually from my code. Is there any possibility to invoke in this way?
|
|
|
|