|
That depends on how you made the application. If you're using the document/view architecture then just make the view class a CFormView (it's the last step when using the wizard).
If not then use this workaround:
(a) Create a dialog resource, and make a class for it. MAKE SURE TO OVERRIDE THE OnOk and OnCancel functions.
(b) In your application add the dialog as a member variable.
(c) In your applications' OnCreate function, create the dialog by calling CDialog::Create, put WS_CHILD | WS_VISIBLE for the style. DO NOT CALL DoModal.
|
|
|
|
|
I want to compile a source code for my pocket pc. It requires the gcc compiler.
The command to compile is as follow:
arm-coff-gcc -S -o CODE.S -mcpu=strongarm1100 -O3 \
-I/usr/local/lib/gcc-lib/arm-coff/3.1/include -I/usr/include CODE.c
I want to know how can I get a copy of GCC for ARM? Is there anyone know about it?
Thanks,
A. Riazi
|
|
|
|
|
Start at:
http://gcc.gnu.org/
Installation could be difficult. On Windows you might need mingw or cygwin to start with. I'm not sure where to go from there. Even on Unix type systems, installation is not exactly trivial. Take your time, search the web and mailing lists to see who has done this. Read all the documentation you can find, then start installing.
gcc is perhaps the most common compiler for any system other than windows. There are better ones in most cases, but it is hard to argue with free, so gcc gets used everywhere. As a C compiler it is good to excellent, for C++ it works, but that is about all you can say.
P.S. If you don't find useful documentaiton, write a log of what you do. When you get it working post instructions someplace. Others will thank you.
|
|
|
|
|
CString cs="http://company.com/some.html";
CWebBrowser2.Navigate(cs, 0, 0, 0, 0);
if the URL above is unavailable, the html page can not be opened - but how can I know about that programmatically?
thx
includeh10
|
|
|
|
|
Hi all,
Please could someone tell me if there is an event which is triggered when a window has completed painting?
I am using “OnShowWindow”, however, it is not possible to ask questions at this stage regarding button states as the window has not been drawn.
Is there another event which I can us that indicates the completion of the drawing of the window.
Thanks for your help
Phil
|
|
|
|
|
What are you trying to do here ? I don't quite get the scenario
|
|
|
|
|
You could hook the EndPaint function call for your application.
Then you would know when EVERY SINGLE WINDOW in your entire program was done painting.
|
|
|
|
|
Hello,
who can tell me how to use the interface IFilterChain correctly?
I have a filter graph in which I would like to pause some filters and play others...
I tried the methods of this interface but wihtout success...
Thanks a lot for your help !
There is no way to happiness, happiness is the way !
|
|
|
|
|
plz help in h323 protocol implementation in vc++
|
|
|
|
|
Hello!
I'm currently writing some documentation for my program and the program should be able to open the CHM file and view a specific HTML page of it.
How can I open a CHM file and define what page it should display when loaded? And no, I cannot use the HtmlHelp API function, I must use ShellExecute, WinExec, or something like this.
Thanks and best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi,
I want to ask three question:
1.open file *.dbf in VC6 ?
2.how to load bitmap image from resource(use funtion Loadimage)?
3.how to process control run with indentify time left?
Thanks very much !
|
|
|
|
|
Load Image:
HBITMAP hBitmap =
(HBITMAP )LoadImage(AfxGetResourceHandle(),
LPCTSTR(IDB_BITMAP),
IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION);
LR_CREATEDIBSECTION ensures colours in your bitmap not mapped to the system palette.
Did not understand other questions.
|
|
|
|
|
for the .dbf you can use a crecordset object. For the connection string, there's an article on this site called "ADO Connection Strings" that will work
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
Hi,
I want to enlist local drives with their icons in the combobox . How can I do that?
Drushti
|
|
|
|
|
Hello Madame Nazar
I think this little piece of code can help you
[code]
CString CNMPDrivesClass::NMPChangeToBinary(DWORD dwVar)
{
long j=(long)dwVar;
int i,k=0;
char Binary[20];
CString str;
str.Format("%d",j);
while(j!=0)
{
i=j%2;
j=j/2;
if(i==0)
Binary[k++]='0';
else
Binary[k++]='1';
}
str.Format("%s",Binary);
return str;
}
void CNMPDrivesClass::NMPReturnNoOfDrives(CUIntArray &NoOfDrives)
{
CString str;
DWORD dwordVar=::GetLogicalDrives();
str=this->NMPChangeToBinary(dwordVar);
for( int drive = 0; drive < 26; drive++ )
{
if(str.GetAt(drive)=='1')
{
NoOfDrives.Add('A'+drive);
}
}
}
[/code]
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Mr. Alok,
Thanx for replying. Now can u please tell me how am I going to connect this code to my combobox.So that logical drives are visible.I have compiled your code. Its error free. But am not getting when and where to call NMPReturnNoOfDrives function in my application??
Thanking u in advance,
Drushti
|
|
|
|
|
Hello Miss Nazar,
it upto when to call these function as i don't know wheather you want to fill combo box on Initialization of Application or at middle.
these code are from my article,i had already published that under name of 'sysutil' u can check that.
anyway here it is small explaination->these fucntion return a mfc collection class,which contain all the drives letter in it one by one.
the below given funtion check type of Drive.
////////////////this function send the type of drives
//0 stand for floppy dirive
//1 stand for hardisk
//2 stand for cdrom
//3 stand for ramdisk
//4 stand for Network Drive
//5 stand for unkown
void CNMPDrivesClass::SendTypeOFDrives(CUIntArray &Stat)
{
CUIntArray Stat1;//this vaiable is created for getting drives list
this->NMPReturnNoOfDrives(Stat1);//getting drives
CString str;
for(int i=0;i<stat1.getsize();i++)
{=""
="" str.format("%c:\\",stat1.getat(i));
="" uint="" i="::GetDriveType(str);
" switch(i)
="" {
="" case="" drive_unknown:="" stat.add('5');
="" messagebox(null,str+"the="" drive="" type="" cannot="" be="" determined.","",mb_ok);="" break;
="" drive_no_root_dir:="" messagebox(null,str+"="" the="" root="" path="" is="" invalid.="" for="" example,="" no="" volume="" mounted="" at="" path.="" ","",mb_ok);
="" drive_removable:="" stat.add('0');
="" disk="" can="" removed="" from="" drive.="" drive_fixed:="" stat.add('1');
="" drive_remote:="" stat.add('4');
="" a="" remote="" (network)="" drive_cdrom:="" stat.add('2');
="" cd-rom="" drive_ramdisk:="" stat.add('3');
="" ram="" disk.="" }
="" }=""
-----------------------------
<i="">"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
class base{
virtual void operator=(*this object) = 0;
};
Why is that code invalid for the compiler?
what i need to do is to force all inhereted classes to realize this operator for their own class type.
is there a way of doing this?
Thanks.
|
|
|
|
|
If you're trying to define a base class that requires that classes derived from it implement their own assignment operator, try this:
class Base {
virtual Base& operator=(const Base& value) = 0;
};
Software Zen: delete this;
|
|
|
|
|
not exactly.
the purpose is to make the derived classes realize this method, however, the paramater of the method is the class itself (the one that realizes the method), which means that every class that derives from this base class will actually have a different parameter.
|
|
|
|
|
Does this help?
template<class T>
class base
{
public:
virtual T& operator=(const T& assignFrom) = 0;
protected:
~base() {}
};
class Foo : public base<Foo>
{
public:
virtual Foo& operator=(const Foo& assignFrom)
{
return *this;
}
};
Curiously Recurring Template[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
i can't use templates. my code is meant for multi platform.
is there another way of doing this?
|
|
|
|
|
From your original question - why doesn't this work, it is because *this is a reference to an object, not an actual type.
virtual void operator=(*this object) = 0;
What are you really trying to achieve? If you want to be able to polymorphically assign objects you should look into the virtual constructor idiom and Co-variant return types. C++ FAQ Lite 20.6 - What is a "virtual constructor"?
AFAIK there is no standard portable way to extract the name of a class from an object without using templates or relying upon facilities built into specific compilers - all of which are far less standard than templates (which are now common and robust in C++). I believe that at one stage GCC had an experimental typeof operator. Some alternative implementations of typeof operators do exist however they all rely heavily upon templates, but even then I'm not sure it would help.
Just as an aside, templates are now implemented in all major C++ compilers, basic template techniques (like the one I demonstrated) will compile under every compilers I know (gcc, vc6, vc7, vc7.1, vc8, comeau, borland, intel, ... the list goes on) - I don't think you can get more platform independant than that.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I have a bit of a problem and am not sure how serious it is. I'd appreciate any advice from the programming community here. A couple of months ago, we built a new MFC application using the MFC application wizard within Visual Studio .NET. I knew I wanted to implement a help system but wasn't really sure which one to use at the time. It was a low priority and we mainly just wanted to build the application and make it work first. Not having had much experience with MFC application development, we created the new application project to use winhelp. Now, after further review I've decided that we probably should have set it up to use HTML help. Is it a reasonable process to to manually change the code and files within the project directories? Has anyone ever had to do this? I'm wondering how much of a hassle it is going to be. If anyone has any insight on this or helplful tips, I'd appreciate it.
Right now my plan is to create two new side by side projects one using each kind of help. Then I want to evaluate the files and directories created by the wizard to see what the differences are. Hopefully, I can go back to the original application directories and tweak the settings and files/directories to changeover to HTML help. If anyone knows of a better way let me know. If you think that what I am doing is correct and the only way; let me know that too. I'd appreciate any input.
Thank you.
|
|
|
|
|
Since it sounds like you're a bit unfamiliar with MFC development, I think you're doing the right thing. Comparing the code the wizard generates for different choices will show you the basics on how different things are accomplished.
Another thing you can do is to run the wizard again, creating an application with the same attributes as yours (single or multiple document, view types, etc.) and using the same file and class names, but selecting HTML help this time. You can then cut/paste the bits and pieces you need out of the wizard-generated code into your existing application.
Software Zen: delete this;
|
|
|
|