|
I don't get it. If you need dialogs, why don't you create a win32 application instead ?
|
|
|
|
|
I already have a console application in which I want to create my dialog. If I tried to create a dialog resource and then add a class to the dialog through class wizard as in MFC it gives me errors
due to #define "StdAfx.H" which is included in the new dialog class created through wizard. And also its not able to recogonize the MFC classes.
|
|
|
|
|
I believe he wants to mimic the logic of old DOS GUI.
|
|
|
|
|
Just as you normally would. What's the specific problem?
Steve
|
|
|
|
|
If I tried to create a dialog resource and then add a class to the dialog through class wizard as in MFC it gives me errors due to #define "StdAfx.H" which is included in the new dialog class created through wizard. And also its not able to recogonize the MFC classes and gives errors.
|
|
|
|
|
|
Which is the opposite of what the OP wanted, yes?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
|
I don't think Visual Studio is set up to do this. If you want to use MFC then you should either create an MFC Windows app that contains the dialogs, or an MFC dialog app with tabs or some similar mechanism. If you want to add dialogs to a console app then you will need to do it manually, by adding all the required Win32/MFC framework components.
It's time for a new signature.
|
|
|
|
|
In a console based application, we cant include the dialog which is created by MFC or SDK. If u still need to use the dialog in console application, convert the your console application to win32 application and try to use MFC dialogs.
---Parthi
|
|
|
|
|
Parthiban wrote: In a console based application, we cant include the dialog which is created by MFC or SDK.
Wrong. You could have a console based application support MFC by including the right header files.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Sounds like you didn't create the console application with the MFC app wizard, so the pre-compiled header settings are not set correctly. You also technically need to initialize MFC in main, though this isn't actually required for some parts of MFC (which I used to worry about in the days of very limited memory, but haven't for years.)
|
|
|
|
|
How can i get the column count of list view ......i m doing this in win 32
|
|
|
|
|
It would be a question for the list header :
{
long lCols = 0;
if (hwndList) {
HWND hwndHeader = ListView_GetHeader(hwndList);
if (hwndHeader) {
long lRes = SendMessage(hwndHeader, HDM_GETITEMCOUNT, 0, 0);
if (-1 != lRes) {
lCols = lRes;
}
}
}
}
virtual void BeHappy() = 0;
|
|
|
|
|
thanks Eugen
i m using this macro's
hHeader = ListView_GetHeader(hListview);
g_ncColumns = Header_GetItemCount(hHeader);
|
|
|
|
|
Not quite sure where I should ask this...I mean, this site really needs a Windows programming section, doesn't it?
Anyways, here goes. I have this DLL trying to call mciSendString (command passed as a parameter). The call works fine in an EXE, but it refuses to do anything on a DLL (I'm testing with "set cdaudio door open"). The function gets called but it hangs. Forever.
Stack, if it helps:
ntkrnlpa.exe!ExAllocatePoolWithTag+0x8ab
ntkrnlpa.exe!MmIsDriverVerifying+0xa08
ntkrnlpa.exe!MmIsDriverVerifying+0x12ea
ntkrnlpa.exe!PoShutdownBugCheck+0x32ce
ntkrnlpa.exe!KeSynchronizeExecution+0x10c
ntdll.dll!KiFastSystemCallRet
!WaitForSingleObject+0x12
!waveOutWrite+0x50c
!mci32Message+0x526
!mciSendCommandW+0x10b
!mciSendCommandW+0x48e
!mciSendStringW+0x31
!mciSendStringA+0x87
Thanks!
|
|
|
|
|
It seems to be a "deadlock"...
(for example, a recursion on the code block,
what is protected by a critical section...
...like: mciSendCommand(..)->mciSendString(..)->mciSendCommand(..))
virtual void BeHappy() = 0;
|
|
|
|
|
So why does it work from an EXE but not a DLL?
And what should I do to fix it?
|
|
|
|
|
May be the analyzing of the stack
before the call will help...
virtual void BeHappy() = 0;
|
|
|
|
|
hello sir
This is my program
char block[3];
block[0] = 'a';block[1] = 'a';block[2] = 'a';
cout << block;
out of this program
aaa╠╠╠╠╠╕ ↕
why this kind unknown character is printing ...
Failure is Success If we learn from it!!
|
|
|
|
|
char block[4];
block[3] = '\0';
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hey everyone! I am wondering why this code keeps throwing me exceptions and how I can fix this problem.
#include <boost/filesystem.hpp>
namespace bf = boost::filesystem;
#include <string>
#include <iostream>
using namespace std;
string e_string = "Error";
int main()
{
string fileName = "C:\\Downloads\\Hits from the Bow\\01 This Time You're Gonna Get it Dir.mp3";
string destination = "c:\\downloads\\test" ;
bf::path fileCopied(fileName);
bf::path fileCopiedDestination (destination);
if (!bf::exists(fileCopied) )
{
cerr << e_string;
}
if (!bf::exists(fileCopiedDestination))
{
cerr << e_string;
}
try
{
bf::copy_file(fileCopied,fileCopiedDestination);
}
catch(std::exception e)
{
cout << e.what();
}
}
Thanks for your time
|
|
|
|
|
Okay So I found out away for the copy_file() function to work
#include <boost/filesystem.hpp>
namespace bf = boost::filesystem;
#include <string>
#include <iostream>
using namespace std;
string e_string = "Error";
int main()
{
string fileName = "C:/Downloads/Hits from the Bow/01 This Time You're Gonna Get it Dir.mp3";
string destination = "c:/downloads/test/this is why it wouldnt work.mp3" ;
bf::path fileCopied(fileName);
bf::path fileCopiedDestination (destination);
if (!bf::exists(fileCopied) )
{
cerr << e_string;
}
if (!bf::exists(fileCopiedDestination))
{
cerr << e_string;
}
try
{
bf::copy_file(fileName,destination);
}
catch(std::exception e)
{
cout << e.what();
}
}
I did not specify the file name. But I do not think this actually solves the full problem because An exception is still being thrown, any ideas at all?
|
|
|
|
|
sorry for the spam.. I think i figured it out. The destination file also dosnt exists in the first place. Thanks anyways.. If any one has any comments i would be happy to hear them!
|
|
|
|