|
Hi,
If all the other classes use the one class, just #include that file in stdafx.h. That way it will be available to
all the other classes. What you have here is called 'circular reference', where one header file gets
included more than once. As the replies suggests, you can prevent this multiple inclusion by using
#ifndef .... #define.....or use a 'forward declaration' in the header file by writing 'class CEditString'. Forward
declarations, however, are only allowed for pointer members. That is, you can say CEditString* stPtr
and not CEditString obj. What I usually do when I have a problem like this is draw a diagram showing
what files have included what, and then I can figure out a way not to include a file more than once. If
this doesn't help you then send me your whole project (syh@ufl.edu) and I'll be glad to look at it for
you. I know how frustrating this can be. Good luck.
sayed hashimi (another overworked graduate student).
|
|
|
|
|
hi,
I have a MDI app with a CRichEditView and Doc. I would like to know how I can everytime i create a new document open a Text File that i created.
This text file is a kinda report where i fill later on.
I use this text as a Template for my file.
Here is my code
void CMainFrame::OnFileNewProject()
{
// TODO: Add your command handler code here
CNewProjectDlg dlg;
if (dlg.DoModal() == IDOK)
{
if(!dlg.m_strProjectName.IsEmpty())
{
PrepareEnvironment(dlg.m_strProject, dlg.m_strProjectName );
//Update Project View
m_pDocProject->AddItem2View(dlg.m_strProjectName);
//Create a new document
CCosmoSQAApp* pApp = (CCosmoSQAApp*)AfxGetApp();
pApp->m_pDocTemplate->OpenDocumentFileNULL, TRUE);
}
}
}
Thanks
olivier
|
|
|
|
|
Hello,
I want to create a new browser as a child window of existing one? Can i do that? Any ideas??
I am using IWebBrowser2 interface. But it opens my page into default browser.
regards,
Mahesh
|
|
|
|
|
Since you are using the Internet Explorer browser control, you can insert an IFRAME HTML tag set into your existing web browser control and have the iframe navigate to the page you want.
use innerHTML method and then call execScript with code to have the IFRAME navigate elsewhere.
It's one way.
-Erik Thompson
|
|
|
|
|
Thanks Erik,
Is there any way without frames? My requirement is not to use frames.
|
|
|
|
|
Dear Mahesh,
There are events that the WebBrowser control emits, which you can handle by implementing the DWebBrowserEvents2 dispatch interface in your program (or something, I forget ).
The event OnBeforeNavigate or OnBeforeNavigate2 (I forget again ) are called or fired after the Navigate() method is called but before navigation begins. It is passed parameters like the URL, do we want to cancel, so forth.
What I would do is to put new child-window-creation code in there, and pass the URL to the new window, which itself could contain a WebBrowser control.
Cheers,
Brian Hart
|
|
|
|
|
Hi,
I'm working on a offline type browser,
for the Downloading of the Content I'm trying to find away to have the downloads occur as low priority, as not to interuppt a users other internet activity,
Any clues as to how this might be done ?
Regardz
Colin Davies
|
|
|
|
|
Colin,
I don't think there is any way to specifically adjust the priority of a socket, but I do believe that Microsoft's networking subsystem automatically adopts the priority of the thread that makes the network request. I think you can probably achieve what you're looking for by either adjusting your application's priority, or, if it is an interactive process, by spinning off a worker thread and lowering that thread's priority.
(I am however shooting from the hip and may be completely wrong
|
|
|
|
|
I think your hip might have good alignment
and setting a "low" level priority might work.
I've also recieved some info about a "TCP window" which is somesort of buffer, you make the window/buffer smaller and the priority decreases, But I fear TAPI/Winitet Like I fear contagious diseases
Regardz
Colin
|
|
|
|
|
Hi,
I had make a CAB file which contains two files
NYPDesk.dll (a deskband working perfect)
nyp.inf
my nyp.inf contains:
===========x============
[Version]
; This section is required for compatibility on both Windows 95 and Windows NT.
Signature="$CHICAGO$"
AdvancedInf=2.0
[Setup Hooks]
hook1=hook1
[hook1]
; run=%EXTRACT_DIR%\setup.exe --activex
run=c:\windows\system\regsvr32 %EXTRACT_DIR%\myBands.dll
==========x=============
I had used <object> tag in the html page. Look like below
<object id="test" classid="CLSID:55555555-5555-5555-5555-555555555555" codebase="test.cab" align="baseline" border="1" width="5" height="5">
Problem:
After opening the html, IE5 displays the error message
"Your current security setting prohibit running ActiveX controls on this page
As a result, the page may not display correctly"
I had enabled all the ActiveX contorl in the Options. but the problem
still exist
Actually, This is my first experience to install the components via IE.
Please provide some good solutions.
TIA
Regards,
SaRose
|
|
|
|
|
Hi!
You must make your control safe for scripting and initializing using the IObjectSafety interface. If you did not do that it can cause problems...
Check the MSDN article "Internet First Steps: Upgrading an Existing ActiveX Control" for more details.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
I want to dill with the uparrow down message, I tried to use
OnKeyDown and OnSysKeyDown ,but when the user pressed the uparrow both of the two function is not called ,why? please help me!
thanks a lot!
|
|
|
|
|
I got a very simple solution for you. All you have to do is to add up arrow click to the accelerator table. You can find it in the ResourceView. Specify an ID for the up arrow click and then just click on the View menu and open Class Wizzard. There select which class you want the up arrow message to be processed and then find the ID you wrote in before. In messages double click on COMMAND and that's gonna add a method into your class that gets called every time you click up arrow.
hope u get it to work
|
|
|
|
|
I got a very simple solution for you. All you have to do is to add up arrow click to the accelerator table. You can find it in the ResourceView. Specify an ID for the up arrow click and then just click on the View menu and open Class Wizzard. There select which class you want the up arrow message to be processed and then find the ID you wrote in before. In messages double click on COMMAND and that's gonna add a method into your class that gets called every time you click up arrow.
hope u get it to work
|
|
|
|
|
Hello, Codeguru.
I used to have the same problem a long time ago, but I did't remeber how to fix this problem so well..
But,
1) We can use PreTranslateMessage funnction in the dialog, and this function catches all message of the
keystorke or mouse event before the message dispatches to each control. And, try to use CWnd* GetFocus()
to check whether the up-arrow message is sure for the control which you want to check.
2) OnKeyDown function of each control may be called in subclassed derived class of each control.
That is, we derived from the new class from each control class, and the message will be catched inside
this class, and OnKeyDown will works.
Since I didn't find these codes in my old project, I'm not sure these works.
But, PreTranslateMessage function will works more than 2)
HTH.
-Masaaki Onishi-
|
|
|
|
|
Actually all you have to do is catch the WM_KEYUP event. Just go to classWizard, select the class
you like to handle the event, and then choose WM_KEYUP from the message entries. Then, choose
add function, and finally choose edit code. Then try AfxMessageBox(" up pressed"), and that will
tell you if you were able to catch it or not. It worked for me, so I am sure it will for you. I tried the
suggestion of adding the ID to the accelerator table but that didn't work. If you got it to work, I would
be interested in how you did it.
sayed hashimi
|
|
|
|
|
does anyone know how to implement a splitter window with a statusbar in each split window?
i've added one like it does in mainfrm and i get no errors but it just doesn't show up. any ideas?
|
|
|
|
|
Have you tried using the member function .ShowWindow ();
of the status bar class you created??
|
|
|
|
|
I created a dialog and add a menu to the dialog.
And also i added the message map for the menu in dialog file
In OnUpdateCommand, i wrote pCmdUI->Enable(FALSE);
But it didn't disable the menu item.
can any one help me
Thanks in advance
Mani
|
|
|
|
|
CDialog does not have the logic for calling OnUpdateCmdUI ... you need to add it yourself.
RKM
|
|
|
|
|
I have been trying to add a toolbar to my Dialog-bases application in VC++6 and i haven't found a way to do it yet.
Does anyone know how to do it or is it undoable?
thanks,
Mark
|
|
|
|
|
The following article:
http://www.codeproject.com/docking/display_dialog_tooltips.asp
shows how to do it.
Regards...
RKM
|
|
|
|
|
Hi,
I developed an application using VC++ 6.0 in win95.
And i copied the exe file with MFC42.DLL, MSVCRT.DLL to other win95 machine it works well.
But i copy the same to winnt or win98 it is not working properly. I have no idea about the problem.
Any other dll files required for win98 or winnt.
Please help me.
Thanks with regards
Mani
|
|
|
|
|
you can compile the exe file with the dll static linked,you just need to open the settings of the project then change the link options to WITH MFC STATIC LINKED ,compile it ,that is ok!
|
|
|
|
|
Hi,
I am working on a little program that is running as NT service. I need to know at any given moment if somebody (user) is logged in to the system or not. It has to be running under System account, so GetUserName() API doesn't help much since it always returns SYSTEM. I know that there have to be a way to do it and it is probably very simple, but I cannot figure it out. The worst part is that I have to get it to work by Monday.
Please help!
Thank you in advance.
Kostya.
|
|
|
|