|
Hello, Codegurus.
We can find the source codes from a couple of places.
1)www.codejock.com
Try to find SDIExplorer example in CJLibrary.
2)Mfcie example of MSDN library of Microsoft.
If you don't have MDSN Library CD, try to find
Mfcie of search of Microsoft web site.
HTH.
-Masaaki Onishi-
|
|
|
|
|
I developed several class using unix g++ compiler. I developed
one class in particular, called CEditString, that edits string
pointers. Every other class that I created uses this CEditString
class. At the top of all these other classes, I type
#include "EditString.H"
and within that class I type
public:
CEditString EditString;
The problem is, when I compile, I get the following error:
/code/EditString.H: In method `CEditString::CEditString()':
In file included from /code/AtomLocation.H:11,
from /code/ProteinStructure.H:13,
from topView.C:7:
/code/EditString.H:56: redefinition of `CEditString::CEditString()'
/code/EditString.H:56: `CEditString::CEditString()' previously
defined here.
I know that I am redefining the class, but if I don't redefine,
then I get that error that 'CEditString' undeclared. This is
really frustrating. Is there any way of destroying the class
so that when I do call it, I am not redefining it?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Erich J. Ruth (an overworked graduate student)
|
|
|
|
|
Hello, Codeguru.
We can use predefine class name in this case.
/*#include "EditString.H"*/
class CEditString;
and within that class I type
public:
CEditString EditString;
HTH.
-Masaaki Onishi-
|
|
|
|
|
That won't work. If you "forward declare" a class (eg, "class CEditString;") you may only use it for pointers and references until the full declaration is given.
|
|
|
|
|
Hello, James.
I already noticed this with Mr. Hamishi post.
But, simply just change CEditString string -> CEditString* string ,and '.' -> '->'.
I think that this is more normal in C++ coding.
Regards.
-Masaaki Onishi-
|
|
|
|
|
Is it possible that within one compile unit, you have #included the EditString.h file twice? Just hazarding a guess here? If that's the case, you should add the following two lines at the start of the EditString.h file;
#ifndef EDITSTRING_H
#define EDITSTRING_H
...
...
...
rest of file and then at the very end of the file add this line
#endif // for the EDITSTRING_H
HTH.
|
|
|
|
|
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
|
|
|
|