|
Thanks Mark.
It is begining to make sense.
But I still don't get the corellation between the dialog resource and the code.
It almost looks like I have to duplicate the controls in code.
I got the following woking - somewhat.
Sorry but it has some garbage in it.
I still have some concerns -
The C_Dialog_Block dlg; assigment "runs" the constructor and initializes the controls. What I do not see is how does the OnInitDialog gets involved.
The CreateEx will do - but I cannot figure out how to create the control in the dialog window - it obviously ends up in the parent view ( either this or m_hWnd works).
I have "Indside Visual C++" and using their examples and it still does not compute!
Their example does all the control initialization in OnInitialDialog and as I said I cannot figure it out how it is called.
PS I forgot to mention that the whole mess is in splitter view - I am trying to edit CListView using modal dialog.
Anyway,
as always thanks for your help, I think I will work on it for a while and hopefully get it.
Cheers Vaclav
C_Dialog_Block dlg; // = new C_Dialog_Block();
int iIndex = 0;
int iVisible = 0; // count visible items
The m_item1 is a CString - not a CEdit and this works just fine
strText = m_columnHeader[iIndex++].strText;
dlg.m_item1 = strText;
The m_item3 is CEdit control
dlg.m_item3.CreateEx(WS_EX_CLIENTEDGE, // Make a client edge label.
_T("STATIC"), strText,
WS_CHILD | WS_TABSTOP | WS_VISIBLE ,
10, 10, 100, 100, m_hWnd, (HMENU)IDC_EDIT3);
This will show up in parent view at correct coordinates - need to go to dialog.
The control ID - (HMENU)IDC_EDIT3 seems to have no effect.
dlg.DoModal();
return 1;
|
|
|
|
|
CInternetSession session;
thrown an assertion error in afxwin1.inl Line 27.
what must i do?
|
|
|
|
|
Since there's many different versions of MFC currently in use,
it's hard to guess what's on line 27 of your afxwin1.inl.
Looking at the CInternetSession::CInternetSession() souce code,
I would guess it's
{ ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }
which shouldn't fail unless you don't have a CWinApp object in your
project.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
you say that i have to use CWinApp? How can i use this class?
thanks for your interests.
|
|
|
|
|
darkonoid wrote: How can i use this class?
Create an MFC application.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
As David Crow mentioned, you should make your app an MFC app, since
CInternetSession is an MFC class.
If you can't use MFC, then you should use the WinINet[^] APIs
directly.
There are some MFC classes that can be used by non-MFC apps, but I'm not
sure if CInternetSession (and its related classes) is one of them.
You could try it by adding these lines to your app's _tmain() function:
AfxInitialize();
AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0);
Those lines may provide the MFC framework with enough initialization to
use CInternetSession.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It's an SDI, a doc with 3 form views,
CMyFormView1,CMyFormView2,CMyFormview3.
After I start the program, it is maximized, then I open a file, it become about 1/4 large as before, it is same as a maximized windows except that its size is smaller.
I've tried to keep
<br />
CMyFormView1::OnInitailUpdate<br />
CMyFormView2::OnInitailUpdate<br />
CMyFormView3::OnInitailUpdate<br />
blank (don't call CFormView::OnInitialUpdate), it still has the problem.
modified on Saturday, December 22, 2007 11:19:42 PM
|
|
|
|
|
Hi guys!
I'm using the c++ windows forms desinger (VS 2008 Express) for the first time.
If I want to declare a new variable constant or array, one of these or both errors appear:
error C3845: 'CalculatoR::Form1::i': only static data members can be initialized inside a ref class or value type
error C4368: cannot define 'i' as a member of managed 'CalculatoR::Form1': mixed types are not supported
I think that I maybe declare the variable at the wrong position. Where do I have to declare variables ond so on?
Thanks for your help.
|
|
|
|
|
Austrian_Programmer wrote: think that I maybe declare the variable at the wrong position
And wrong forum, I suppose...
Post your question to the Managed C++/CLI one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hi,
I am using VC++ 2005 with SP1 to develop my application. I want to deploy it on a target machine by using Private side by side assemblies. Hence I have created appropriate application manifest file and copied Microsoft C/C++ Runtimes libraries along with their manifest files to the bin folder of my application and ensure that it is in the path. However I am facing an issue due to a 3rd party library used by my application. This library is a dll built by using VC++ 2005 base libraries. When I try to execute my application I get VC++ runtime error.
Installing VC++ 2005 SP1 redistributable libraries does solves the problem but then my application will be using shared side by side assemblies. I would like to deploy with private side by side assemblies.
Can someone please guide me how do I deploy my application successfully on the target machine taking into account such scenarios.
Thanks and Regards.
|
|
|
|
|
A simple question: I'm creating an edit control with the usual CreateWindow function. How can I change the background and text color of this control? Thanks.
|
|
|
|
|
See this message :WM_CTLCOLOREDIT .
|
|
|
|
|
|
You're welcome.
|
|
|
|
|
why do i get
Run time error!
c:/.../.../pc.exe
Abnormal program termination.
while i'm running my application(MFC) in VISTA.
whereas it is working fine in XP.
Can any one please help mi in this regard.
thanks in advance...
Saavana...
|
|
|
|
|
Can you more explain about your program,did you use of debugger?
|
|
|
|
|
HI
Iam trying to put dockable toolbar on a dialog.I wrote the following code but it is fixed on the top but it is not dockable.Is there any changes plz tell me.
toolbar.CreateEx(this);
toolbar.LoadToolBar(IDR_TOOLBAR1);
toolbar.SetBarStyle(CBRS_ALIGN_TOP|CBRS_TOOLTIPS| CBRS_GRIPPER|CBRS_FLOAT_MULTI );
RepositionBars(AFX_IDW_CONTROLBAR_FIRST , AFX_IDW_CONTROLBAR_LAST, 0);
thanque
#sanroop#
|
|
|
|
|
|
Hello All,
i'am using printing option in my project , i'am giving data to the printer from my database(MS Access).
if my database having 10 set of data , but i need to print the 10th set data, so i used the while loop to get the last set of data.
but my printer stores the all 10 set of data in it's temporary memory ,it print the 10th set of data with the last 9th set of data.
so can u please tell how to clean printer memory?
Panthal
|
|
|
|
|
Are you sending the ninth record to the printer?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Then how is it being printed?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Let's say there is a file which has content like the below for example:
[Configuration.x86]
Memory = FF1040A0
IO = 2FF
Flag = 12,15 With iostream library,
1. how to locate and modify the value in IO section from "2FF " to "A2FF "?
2. how to delete the token "12, " in Flag section?
Thanks.
Maxwell Chen
|
|
|
|
|
Why do you want to use iostream when GetPrivateProfileString will make your task so much easier?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
CPallini wrote: Why do you want to use iostream when GetPrivateProfileString will make your task so much easier?
My target is oem*.inf in C:\Windows\inf. GetPrivateProfileString is for .ini files. It looks like also working for .inf files. I will try it on Monday. Thanks!
By the way if the target is gereral article content, what would be a better way (efficient) to modify and to delete substrings in the file?
For example (below paragraph), to delete "will ", and locate the next word "make " and append an "s" to form "makes ".
Why do you want to use iostream when GetPrivateProfileString will make your task so much easier?
Maxwell Chen
|
|
|
|