|
Hello.
I've made a MFC SDI app with the AppWizzard. The main window is a CFormView child, with an associated dialog. I've created another dialog (IDD_D2), and with the appwizzard i've created another class, a CFormView child, and i've associated it to the new dialog IDD_D2.
The project is called jmn. In jmnView.h & jmnView.cpp i've got the main window. The new CFormView is in other files.
Should i declare an object for the new CFormView i've created? where? in jmnView.h?
How do i create, show it, and close it?
i know that with dialogs you've got the DoModal function. I don't want a dialog, i want a resizable window, that's why i want a CFormView child.
thanks!!
|
|
|
|
|
Depends on what you're really trying to do. If you wanted to use your formview, in your app's InitInstance() you'll see something like:
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MAINFRAME,<br />
RUNTIME_CLASS(CTest1Doc),<br />
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CTest1View));
AddDocTemplate(pDocTemplate);<br />
replace your formview's class name with whatever you named it with in the wizard. e.g. above CTest1View would be replaced with the name of your form view.
I may have missed something else but I believe that is basically it. If on the other hand you want to keep your appwizard's auto generated formview and your formview, you'll have to either switch views and/or use a splitter window implementation to show both views simultaneously. This is usually done in mainframe.cpp. HTH.
|
|
|
|
|
that's not really what i meant, sorry..
i don't want to change the main view. What i want, is to open another window, for example when i press a button. If i used a dialog, i would use the DoModal method, but i want to open a Frame window, a window which i could resize. i think i didn't have to use the word CFormView
|
|
|
|
|
Does anyone have code that downloads a file from the internet and saves it into a file. I know I have to use this:
HRESULT URLDownloadToFile( LPUNKNOWN pCaller,
LPCTSTR szURL,
LPCTSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);
But I am not sure how I get this to work.
-Ryan M.
|
|
|
|
|
CString strUrl = _T("http://ravib.com");
CString strFilename = _T("C:\\ravib.txt");
HRESULT hResult = ::URLDownloadToFile (NULL, strUrl, strFilename, 0, NULL);
if (hResult != S_OK)
error(); /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
|
Hey can someone please point me to an article about how to set up a keyboard accelerator in a dialog based application i didnt see a link for stuff on accelerators here :P
|
|
|
|
|
|
:-Opleas help my to creat a graphic veiw to telnet aplication
thenk for all
|
|
|
|
|
Im having trouble using sockets with MFC
i have downloaded many examples
but everytime i try to compile my own they wont work
i need a simple tutorial to get me started with them
i would also like to figure out how to use sockets without MFC
|
|
|
|
|
Beej's Guide to Network Programming[^]... the best tutorial i've ever read about sockets. there, search for the PDF.
in fact, it's not exactly about windows sockets (it is even linux oriented), but this recalls the Berkeley sockets, which is quite the same whatever the plateform.
For windows, you just have to #include <winsock.h> , and to write some lines with WSADATA :
<font style="color:blue;">#include</font> <winsock.h>
<font style="color:green;">
{
WSADATA wsaData; <font style="color:green;">
<font style="color:green;">
<font style="color:blue;">if</font> (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) {
fprintf(stderr, <font style="color:purple;">WSAStartup failed.\n"</font>);
exit(1);
}
<font style="color:green;">//...</font>
}
But don't worry, that is explain it the 1.5. Note for Windows Programmers
have a look, that's interresting !
Best regards
TOXCCT >>> GEII power
|
|
|
|
|
Here are a couple of nice non-MFC tutorials:
You'd need to provide more information about the compilation errors you're getting if you'd like help!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
socketsdlg.h(34) : error C2146: syntax error : missing ';' before identifier 'cmSocket'
socketsdlg.h(34) : error C2501: 'CMySocket' : missing storage-class or type specifiers
socketsdlg.h(34) : error C2501: 'cmSocket' : missing storage-class or type specifiers
SocketsDlg.cpp
socketsdlg.h(34) : error C2146: syntax error : missing ';' before identifier 'cmSocket'
socketsdlg.h(34) : error C2501: 'CMySocket' : missing storage-class or type specifiers
socketsdlg.h(34) : error C2501: 'cmSocket' : missing storage-class or type specifiers
SocketsDlg.cpp(176) : error C2065: 'cmSocket' : undeclared identifier
SocketsDlg.cpp(176) : error C2228: left of '.Create' must have class/struct/union type
SocketsDlg.cpp(177) : error C2228: left of '.Connect' must have class/struct/union type
you can view the source of the files here
http://members.lycos.co.uk/archer282/Sockets/
|
|
|
|
|
You need to #include MySocket.h .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
thank you.
i never even thought to make sure thet it was inlcluding the header.
i just assumed since it was an MFC project that it would have been done automatically.
|
|
|
|
|
You all must be familiar with the send to menu in win, like when you right-click a file you get send to and then some program can I ad my program here(programaticly that is). Or even better can you ad it to the right-click menu instead, like when you right click it it will say edit with myapp next to edit with visual studio.?
|
|
|
|
|
|
I guess it's as simple as adding *.lnk file to some directory in windows root (at least it worked with simple directory links). Too bad I forgot the exact path, but you can easily find it anyway, I'm sure.
|
|
|
|
|
Someone told me that you cant have VC++ 6.0 and VC++ .net on the same computer because they will mess each other up. Is this true? If so, is there anyway around it?
Thanks a lot
David
|
|
|
|
|
Bullsh_t!
There are both VC++ 6 and VC++.NET on this computer which I am using. No problem with them at all.
Maxwell Chen
|
|
|
|
|
i confirm max'l chen's post... i both use VC++ 7 and .NET and i've got no pb... (i also have a piece of the VC++ 5 !!! )... no problem so
TOXCCT >>> GEII power
|
|
|
|
|
The trick is to install VC++ 6.0 first and if you uninstall it, you need to run a repair on the VC++.NET install to restore the file associations.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I have VC++ 1.52c (for DOS based apps), Visual Studio 6.0 and Visual Studio .NET 2003 installed on each of my machines (home using XP Pro, work using W2K and a laptop using XP Pro). No problems at all...
Steve
|
|
|
|
|
Steve Mayfield wrote:
have VC++ 1.52c
How did you install VC++ 1.52c on WinXP? I am curious!
My VC++ 1.5x only allows me to install on Win98...
Maxwell Chen
|
|
|
|