|
Create your sdi application with a form view
|
|
|
|
|
yes sir i create it with form view but then i create a second form whose base class is CMDIChildWnd wher split window is created .
now i want to go from first forms menu to second form .
Ashish Dogra
MCA
Noida
|
|
|
|
|
Your second form should also be derived from CFormView. Use SetActiveView() of your mainframe window to switch between your forms.
|
|
|
|
|
Do you need to call one dialog
whitesky
|
|
|
|
|
sir i need to call a form
on which split window is shown
Ashish Dogra
MCA
Noida
|
|
|
|
|
Hope I understood your question
if you want to call dialog you can use from a variable from your dialog and use m_dialog.Create(ID_DIALOG) in your program and use m_dialog.Show(1);
whitesky
|
|
|
|
|
hi sir plz solve my problem
Ashish Dogra
MCA
Noida
|
|
|
|
|
Hi guys this is rocky.
I got stuck in a problem plz help me.
I want to read a text file which is having unciode charachters in C/C++.
i m using normaal fopen function but can't get the result fine..
here is the small peace of codeee
if ((fp = fopen("d:/GRCasual.txt", CFile::modeRead|CFile::typeBinary)) == NULL)
{
return 0;
}
while(!feof(fp))
{
/*fseek(fp,sizeof(char),SEEK_CUR); */
retbuf = fgets(buf, 200, fp);
}
thnx in advance guys ............
i m waitin for ur replies..........
Best Regards
Rocky
|
|
|
|
|
Declare the "buf" parameter in fgets(buf, 200, fp) as wchar_t type.
Jubin Chawda
braindrain1@rediffmail.com
-----------------------------
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
i m gettin an exception that
error C2664: 'fgets' : cannot convert parameter 1 from 'wchar_t *' to 'char *'
what abt this
thnx in advance
Best Regards
Rocky
|
|
|
|
|
Try fgetws instead of fgets .
(However it is unlikely that your second parameter of fopen will work).
|
|
|
|
|
Thnx for the reply first
thnx for giving me some time
here is the peice of code i m not getting the result
FILE* fp = NULL;
wchar_t* buf = (wchar_t*)malloc(sizeof(wchar_t) * 200);
wchar_t* retbuf = NULL;
if ((fp = fopen("d:/GRCasual.txt", "r")) == NULL) // opens the file
{
return 0;
}
while(!feof(fp))
{
/*fseek(fp,sizeof(char),SEEK_CUR); */
retbuf = fgetws(buf, 200, fp);
}
if( fp )
fclose(fp);
return 0;
|
|
|
|
|
Instead of
if ((fp = fopen("d:/GRCasual.txt", "r")) == NULL) try this:
if ((fp = fopen("d:\\GRCasual.txt", "rb")) == NULL)
I hope it helps.
|
|
|
|
|
See OLE2A USES_CONVERSION;
whitesky
|
|
|
|
|
Sorry Guys but can't get the result with this also OLE2A USES_CONVERSION
plz help
thnx in advance
Rocky
|
|
|
|
|
you said "cannot convert parameter 1 from 'wchar_t *' to 'char *" whats error? and i said use OLE2A
whitesky
|
|
|
|
|
Guys this is the code but cant read the unicode file...........
if there is any problem in it tell me i will solve it..........
FILE* fp = NULL;
wchar_t* buf = (wchar_t*)malloc(sizeof(wchar_t) * 200);
wchar_t* retbuf = NULL;
if ((fp = fopen("d:/GRCasual.txt", "r")) == NULL) // opens the file
{
return 0;
}
while(!feof(fp))
{
/*fseek(fp,sizeof(char),SEEK_CUR); */
retbuf = fgetws(buf, 200, fp);
}
if( fp )
fclose(fp);
return 0;
thnx in advance
regards
Rakesh
|
|
|
|
|
How could i judge the Cd-rom door's status?(open or closed). Pay attention to that here is Cd-rom not DVD-rom, I used the SCSI command "Mechanism Status" to get the dvd-rom door's status successfully, but it can't work on Cd-rom, so what should i do to fix this trouble?
Go go go, roger that. Enemy sighted!
|
|
|
|
|
U look into DeviceIoControl() with IOCTL_STORAGE_EJECT_MEDIA as a second parameter.
Jubin Chawda
braindrain1@rediffmail.com
-----------------------------
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
|
Thanks you all for your helpful infos, but all seems not work fine.
Is there a command of SCSI just as same as "mechanism status" command which can work on DVD-ROM?
Or some other helpful infos?
|
|
|
|
|
|
Thanks for your help, whitesky!
But I wonder if you really understand what I want to realize!
I just want to know the status of CD-ROM, it is opened or closed?
The MCI command can't work at all, I tried it before, and WM_DEVICECHANGE message also can't work. And I tried MMC command(APSI programming),but it can only work on DVD-ROM, do not work on CD-ROM! That's my trouble.
My original purpose is that if you right click the CD/DVD-ROM icon, the eject menuitem can take a little change for it can change to "Insert" if the door is already opened, and back to "eject" if the door is closed. For this, I must know the status of the door, it is closed or open?
One day a pretty girl asked me: "Do you think you are handsome?"."I don't think so!" She gave a slap in my face:"Why lying?"
|
|
|
|
|
Hello everyone,
I am meeting with a strange linking error regarding to operator overloading. I am creating a C++ static lib, and then linking it with a C application. Here is the error message and source codes,
I am using adapter.cpp, adapter.h, foo.cpp and foo.h to create a static lib called foo.lib, then link it with a C application (goo.c). There is no problem to generate the static lib foo.lib.
Any comments to solve this link error?
<br />
error LNK2019: unresolved external symbol "private: class FooNameSpace::Foo __thiscall FooNameSpace::Foo::operator=(long)" (??4Foo@FooNameSpace@@AAE?AV01@J@Z) referenced in function "private: __thiscall FooNameSpace::Foo::Foo(<br />
long)" (??0Foo@FooNameSpace@@AAE@J@Z)<br />
<br />
fatal error LNK1120: 1 unresolved externals<br />
adapter.cpp
<br />
#include "adapter.h"<br />
#include "foo.h"<br />
<br />
using namespace FooNameSpace;<br />
<br />
void compute(void)<br />
{<br />
Goo g;<br />
g.computeFoo();<br />
}<br />
adapter.h
<br />
#ifdef __cplusplus<br />
extern "C" {<br />
#endif<br />
<br />
void compute (void);<br />
<br />
#ifdef __cplusplus<br />
}<br />
#endif<br />
foo.cpp
<br />
#include "foo.h"<br />
<br />
using namespace FooNameSpace;<br />
<br />
Foo Foo::operator=(long value)<br />
{<br />
this -> value = value;<br />
return (*this);<br />
}<br />
foo.h
<br />
namespace FooNameSpace<br />
{<br />
class Foo<br />
{<br />
<br />
private:<br />
long value;<br />
<br />
Foo (long value) { (*this) = value; }<br />
inline Foo operator= (long value);<br />
friend class Goo;<br />
};<br />
<br />
class Goo<br />
{<br />
public:<br />
void computeFoo()<br />
{<br />
Foo foo = Foo(0L);<br />
}<br />
};<br />
}<br />
goo.c (link with foo.lib)
<br />
#include "adapter.h"<br />
#include "windows.h"<br />
<br />
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
LPWSTR lpCmdLine, int nCmdShow)<br />
{<br />
compute();<br />
return 0;<br />
}<br />
thanks in advance,
George
|
|
|
|
|
I think no error will be generated if you:
- remove the
inline keyword from the declaration of Foo::operator = ; - or, move the implementation of
Foo::operator = from foo.cpp to foo.h file; - or, place the implementation of
Foo::operator = function inside the Foo class.
I hope it helps.
|
|
|
|