|
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
|
|
|
|
|
Maxwell Chen wrote: My target is oem*.inf in C:\Windows\inf. GetPrivateProfileString is for .ini files. It looks like also working for .inf files.
Indeed it works whatever file extension is (only the file format is important, it must be *.ini compliant)
Maxwell Chen wrote: Thanks!
You're welcome.
Maxwell Chen wrote: 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?
You have to:
(1) load the file in a buffer.
(2) make all you search/replace/add operations into the buffer.
(3) write the buffer to the initial file.
Point (2) maybe accomplished with hand-crafted search operations, using a string class (for instance std::string or CString ) or a powerful tool like a Regular Expression parser (see for instance http://www.ultrapico.com/Expresso.htm[^]).
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 have a application for mobie application.
all v know when v right click the icon button there will be some option like exit,about , start ,stop ..
i used the code
void CControlContextDlg::OnContextMenu(CWnd*
/*pWnd*/, CPoint point)
{
// TODO: Add your message handler code here
// Load the desired menu
CMenu mnuPopupSubmit;
mnuPopupSubmit.LoadMenu(IDR_SUBMIT);
// Get a pointer to the button
CButton *pButton;
pButton = reinterpret_cast<CButton
*>(GetDlgItem(IDC_SUBMIT_BTN));
// Find the rectangle around the button
CRect rectSubmitButton;
pButton->GetWindowRect(&rectSubmitButton);
// Get a pointer to the first item of the menu
CMenu *mnuPopupMenu =
mnuPopupSubmit.GetSubMenu(0);
ASSERT(mnuPopupMenu);
// Find out if the user right-clicked the button
// because we are interested only in the button
if( rectSubmitButton.PtInRect(point) ) // Since
the user right-clicked the button, display the context menu
mnuPopupMenu->TrackPopupMenu(TPM_LEFTALIGN |
TPM_RIGHTBUTTON, point.x, point.y, this);
}
...
in this when v right click the button popup menu appears but i want when i right click the tray icon popup menu should appears .
help me
advanced thanks
K.Guru moorthy
k.guru moorthy
|
|
|
|