|
How can I find out how to use GetClientRect?
|
|
|
|
|
|
Oops! I almost forgot to say. Thanks!
|
|
|
|
|
Guys I am stuck .... I am trying to make a MFC application using opengl. I want to find out how to select an Object in a opengl screen of the MFC appliaction... please guide .. its URGENT>>>>>
|
|
|
|
|
I'm pretty sure that NeHe has stuff on this. It should just be a case of changing the screen co-ordinates to the world-space co-ordinates I think but for more info go to http://nehe.gamedev.net/ - A site for everything OpenGL based.
|
|
|
|
|
I have a program in which I have a splitter Window of Rich Edit View and an edit view.
I have Given a facity in the RichEdit View Through Which Whenever I right Click on a Particular words its Synonyms are displayed in a Separate dialog Box.
But the Program is Exiting without any Prompt whenever I Decalre a CString or perform a file opening Operation in
that Dialog Class.
The Same Program Runs All right in the Debug version but the above probelms are being found out in the Release Version
Can Anyone Suggest me the Solution...
Samir Sood
|
|
|
|
|
|
O.K. now here is something that I hope someone can explain to me.
I have been attempting to a simple DOS command line diroectory listing using MSVC.
But for the life of searching I find nodda about really how to write this.
This is what I have been attempting to do.
A simple VC code that will list the files just like the DOS dir command.
with this it should show the file date modified, and date created.
The ultimate goal I have to to be able to have the following:
command line directory listing application that would delete files past ## of days.
like
dir c:\files\*.doc -del:20
this would delete files in that directory that are past 20 days from the current date.
If anyone has something that would work in MSVC just to get me to at least show the files, and dates credted/modified, hopfully I can understand the rest, but without dir.h I cannot seem to go any farther.
|
|
|
|
|
If you look up CFileFind (I think) you'll find an MFC class which does this. It will list all of the files and will be able to give you that sort of information about them. Using a win32 API call like DeleteFile(mfilename) would then delete them for you.
|
|
|
|
|
#include stdio.h>
#include time.h>
#include iostream.h>
#include windows.h>
#include io.h>
int GetDir(char* dPath) {
typedef struct _FILETIME { DWORD dwLowDateTime; DWORD dwHighDateTime;} FILETIME, *PFILETIME;
WIN32_FIND_DATA FileData;
HANDLE hFile;
hFile = FindFirstFile(dPath,&FileData);
if ( INVALID_HANDLE_VALUE == hFile ) {
cout << "No files" << endl;
return false;
}
for ( ;; ) {
printf(FileData.cFileName);
printf("\n");
if ( 0 == FindNextFile(hFile, &FileData ) )
break;
}
return true;
}
int main() {
system("CLS");
GetDir("C:\\*.*");
system("pause");
return true;
}
O.K. this is what I have.
now sure it can list the files, but how in the love of all that is holy list the files dates as well.
I always get error messages when I try to add printf(FileData.ftCreationTime);
I get the error:
'printf' : cannot convert parameter 1 from 'struct _FILETIME' to 'const char *'
|
|
|
|
|
yeah, thats because you're trying to display the FILETIME struct using a function that accepts a const char* as an arguement. Try converting the FILETIME structure to a SYSTEMTIME structure using FileTimeToSystemTime(). That way you'll have the date in all of its component parts so you can display it using
printf("%s %f %f %f\n",filename,daycreated,monthcreated,blah blah);
I just grabbed that from MSDN but it should work no probs, other than the printf because I can't remember what the right letter to use for a WORD is.
Good luck, MSDN is a great thing.
|
|
|
|
|
hmmmm,
O.K. trying to get the hang of this, but always seem to get errors.
How do I call the SYSTEMTIME structure to work correctly?
|
|
|
|
|
Hello, I'm having a problem importing the msxml4 library into my program. Where does #import and using namespace MSXML2; statements belong? I have tried placing them before and after the #included files however I'm still receiving errors.
Thank you for your help!!
John
|
|
|
|
|
i always put them in my stdafx.h, at the bottom.
what kind of errors?
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
When I compile my app with the this code
#include "stdafx.h"
#include <atlstr.h>
#include <iostream.h>
#include <wininet.h>
#import "C:\WINDOWS\system32\msxml4.dll"
using namespace MSXML2;
void main(int argc, char* argv[])
{
DWORD dwConnFlags;
if (InternetGetConnectedState(&dwConnFlags, 0))
{
try
{
IXMLDOMDocumentPtr pXMLDoc = NULL;
}
}
}
I receive these errors in the output window.
Compiling...
stdafx.cpp
Compiling...
XMLApp.cpp
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) : warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma deprecated
c:\Documents and Settings\John\My Documents\Visual Studio Projects\XMLApp\XMLApp.cpp(17) : error C2872: 'IXMLDOMDocumentPtr' : ambiguous symbol
could be 'c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\comdefsp.h(1226) : _com_ptr_t<_IIID> IXMLDOMDocumentPtr'
with
[
_IIID=_com_IIID
]
or 'c:\Documents and Settings\John\My Documents\Visual Studio Projects\XMLApp\Debug\msxml4.tlh(300) : MSXML2::IXMLDOMDocumentPtr'
Thank you for your help!!
John
|
|
|
|
|
I'm trying to use a keyboard accelerator in my aplication (and MFC dialog based application). I want to handle the event that happens when the user presses a combination of Ctrl + Shight + N, so I have defined a new Line int the Accelerator editor with this values:
ID = ID_ACELERATOR_NEXT , Modifier = Ctrl + Shift, Key = N, Type= VIRTKEY.
Also I have defined in my dialog message map the following line:
ON_COMMAND(ID_ACCELERATOR_NEXT, OnAcceleratorNext)
but it doen't works. I can't handle the event. What I'm doing wrong ?
Thanks.
|
|
|
|
|
Hi!
I've developed an application whitch calls (by pressing a button, using DoModal) a dialog window with a webbrowser control into it (using the CWebbrowser2 class). The application works great but I've noticed that each time I execute (or refresh) my web browser dialog the application's memory usage increases every time (by about 300-400k)!!! I can start of with a 6 meg application and end up with one using 40 meg in memory... Then the application crashes!
My question is:
1 - Could it be something related to the browser's cache!?
2 - How can clear memory usage to avoid crashing?
3 - Could it be an OCX-related problem?
Thanx!!!
-------------
-= Nasty_p =-
|
|
|
|
|
Hi all,
I have a very trivial question.
I have a 16-bits register. How to retrieve n-LSBs and nHSBs from the register.
Give some examples
thanks
regards
/rsasalm
|
|
|
|
|
I am sure there are C++ library functions do get the lByte and hByte. Nonetheless, the simple solution is ASM.
_asm()
{
mov ax, twoBytes
mov high, ah
mov low, al
}
Kuphryn
|
|
|
|
|
I added the debug toolbar to my IDE but it didnt put the ! for execute without debug button in the bunch. In the customize debug toolbar dialog I dont see any way of adding the exclamation mark. I miss that button. Is it just not there anymore? Its in the menu item...
Appreciate your help,
ns
|
|
|
|
|
hello @all,
first a short introduction:
i have an mdi program and the menu contains:
File
|
v
Service
when i pressed the service, a dialog should open, where i can enter a correct password and press 'OK'. if the password is right the menu should look like:
File
|
v
Service
IamHere
i tried:
the first menu is the mainframe menu and then i make a second menu (IDR_MENU_PW). after i pressed the 'OK' this happens:
<br />
UpdateData(true);<br />
<br />
if(m_strPW=="Hello")<br />
{<br />
HMENU menu;<br />
menu = LoadMenu(AfxGetApp()->m_hInstance, MAKEINTRESOURCE (IDR_MENU_PW));<br />
::SetMenu(*(AfxGetApp()->m_pMainWnd), menu);<br />
CDialog::OnOK();<br />
<br />
}<br />
else<br />
{<br />
CString wrong;<br />
wrong.Format("Wrong PW");<br />
MessageBox(wrong, "Attention!", MB_ICONERROR | MB_OK);<br />
}
now the second menu 'opens' and the first one is 'closed'.
now i want, that when i pressed 'IamHere' a messagebox opens. i make a 'COMMAND' function with the wizzard in the old class: 'MyProgrammView'.
but when i run the program, and enter the right passwort, there the second menu is, but i can not use the function behind 'IamHere'. it is grey. but when i pressed on the 'Service' i get the same dialog as before to enter my password.
what´s wrong?
thank you
sunny
|
|
|
|
|
I am really not competent in mdi's, but maybe this link[^] may help you. You should use something like EnableMenuItem() with MF_ENABLED flag. Just look at this one in the MSDN.
Sunnygirl wrote:
MessageBox(wrong, "Attention!", MB_ICONERROR | MB_OK);
Just love that debug windows
~RaGE();
|
|
|
|
|
Sunnygirl wrote:
i make a 'COMMAND' function with the wizzard
Are you sure you did it correctly? I made a test MDI application with two menus as you said - except for the dialog but i think it's ok - and everything worked properly.
rechi
|
|
|
|
|
thanks for reply.
i make it so often...again and again.....
but please, can you send me your complete test program?
sunny
|
|
|
|
|
Sunnygirl wrote:
i make a 'COMMAND' function with the wizzard in the old class: 'MyProgrammView'
If you want to have IamHere called even when no child is open, you must catch the WM_COMMAND in CMainFrame, not in MyProgrammView.
rechi
|
|
|
|