|
It's possible set a file dialog (CFileDialog) to let select to user only directories?
I want to do this to choose the work directory of my software.
Somebody can help me?
Thanks a lot
|
|
|
|
|
|
Or here's a function that i use to return the folder name in a CString:
CString GetFolder()
{
LPMALLOC pMalloc,pMalloc2;
CString strDirectory;
BROWSEINFO bi;
CString strPath1,strPath2;
char pszBuffer[MAX_PATH];
LPITEMIDLIST pidl;
bi.hwndOwner = GetDesktopWindow();
bi.pidlRoot = NULL;
bi.pszDisplayName = pszBuffer;
bi.lpszTitle = _T("Select First Directory");
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;
bi.lpfn = NULL;
bi.lParam = 0;
if (::SHGetMalloc(&pMalloc) == NOERROR)
{
if ((pidl = ::SHBrowseForFolder(&bi)) != NULL)
{
if (::SHGetPathFromIDList(pidl, pszBuffer))
{
strDirectory = pszBuffer;
}
pMalloc->Free(pidl);
}
pMalloc->Release();
}
return strDirectory;
}
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
Hi,
How do I add an unicode support to a code.
also when i build I would need the project configuration list to seperately display one with unicode, other without unicode.
How do i add this "w / without unicode" entry in the project configurations.
thanx,
hiva P
|
|
|
|
|
I have an executable file which was compiled in debug mode.
When I run it in debug mode, I get an error message before the code even seems to execute (InitInstance on my CWinApp class doesn't even get called). The error message says: "C:\path\to\filename.dll" File not Found.
This filename.dll is the output from another project I have, but the 2 projects are unrelated.
If I run the same exeutable file in non-debug mode, then there are no issues like this.
Does anybody know why my application might be trying to link up with this filename.dll ? Does VC++ have someplace where it keeps the list of DLLs it tries to link with at runtime?
Any and all help appreciated.
|
|
|
|
|
Hi
Please look into Project->Settings->Link, Object/Library modules is empty or not.
Hope this would help you.
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
I'm loading:
advapi32.lib
So, this isn't the issue.
|
|
|
|
|
Howdy - I've got the code I need to add and remove menu items that I need, but I'm not sure where to place this code.
Using an SDI MFC app, what message do I handle to know that the user dropped down a menu in the main menu?
Thanks!
Marcus Spitzmiller
"Why must life be so hard? Why must I fail at every attempt at masonry?" - Homer
|
|
|
|
|
Please, try out WM_INITMENUPOPUP. It is useful to modify popup menu at runtime
|
|
|
|
|
I guess I overlooked that one, Thanks!
Marcus Spitzmiller
"Why must life be so hard? Why must I fail at every attempt at masonry?" - Homer
|
|
|
|
|
My application is MDI application.
So,I cannot know what parameter use in following code???
m_tabPages[0]->Create(CMyTabDlg,this);
>>>>>>>>>>>>>>>This is my error>>>>>>>>>>>>>>
MyTabCtrl.cpp(54) : error C2275: 'CMyTabDlg' :
illegal use of this type as an expression
MyTabdlg.h(13) :
see declaration of CMyTabDlg'
>>>>>>>>>>>>>>>This is My code>>>>>>>>>>>>>>>>
//MyTabCtrl.cpp
CDialog *m_tabPages[2];
//MyTabCtrl.cpp
void CMyTabCtrl::Init()
{
m_tabCurrent=0;
m_tabPages[0]->Create(CMyTabDlg,this);
//what i use parameter
m_tabPages[1]->Create(CMyTabDlg,this);
//what i use parameter
m_tabPages[0]->ShowWindow(SW_SHOW);
m_tabPages[1]->ShowWindow(SW_HIDE);
SetRectangle();
}
//MyView.h
CMyTabCtrl m_tab;
//MyView.cpp
void CMyView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
m_tab.InsertItem(0, _T("One"));
m_tab.InsertItem(1, _T("Two"));
m_tab.Init();
}
|
|
|
|
|
As I thought, CMyTabDlg was a class name, not variable name, so that, it is illegal to appear as a function argument.
|
|
|
|
|
//CMyTab
//MyTab.h
CDialog *m_tabPages[2];
//MyTab.cpp
m_tabPages[0]->Create(CMyTabDlg,this);
My demo is MDI application.
i have a class.This is CMyTabCtrl,
i found codeproject web site.
this demo is dialog base application.
i run this demo is ok.
and i making mdi application.
and use this class.
but i don't know.what parameter place in
"CWnd* pParentWnd".
>>>>>m_tabPages[0]->Create(CMyTabDlg,this);
>>>>>function argument(CDialog::Create)
BOOL Create( LPCTSTR lpszTemplateName,
CWnd* pParentWnd = NULL );
|
|
|
|
|
BOOL Create( LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL );
In this case, the first argument typed string?
|
|
|
|
|
Yes!!!
i change.................
m_tabPages[0]->Create(IDD_MY_DLG,this);
thank you so much...........
|
|
|
|
|
Can you make me a program in C++ that taking the inverse of a matrix using Gaussian Elimination?
|
|
|
|
|
if you aren't going to sell or distribute the source code you can use or modify the source from numerical recipes http://www.library.cornell.edu/nr/cbookcpdf.html
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
|
|
|
|
|
you're nicer than i am mate
i'd have told him to bugger off and do his own homework
cheers
Bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
C++ Seeker wrote:
Can you make me a program in C++ that taking the inverse of a matrix using Gaussian Elimination?
I assume you mean Gauss-Jordan elimination, but I wouldn't do it that way. It works, but it's very unstable. A much safer way would be to use LU decomposition.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
C++ Seeker wrote:
Can you make me a program in C++
yes i can, but i won't
we're not on www.MakeMyHomeworkProject.com
TOXCCT >>> GEII power
|
|
|
|
|
I cut or copy a file(Directory),before I paste it in my own definite directory,for example,C:\temp ,i want to encrypt the file or directory ,how can i ?use shell or use hook?
thanks
cjg
|
|
|
|
|
BOOL CPopguardDlg::Shell_APP(CString str)
{
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof (SHELLEXECUTEINFO);
sei.lpVerb = NULL;
sei.lpFile = str;
sei.nShow = SW_SHOW;
sei.hInstApp = NULL;
sei.lpDirectory = NULL;
sei.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS;
sei.lpParameters = NULL;
if (ShellExecuteEx (&sei) )
return TRUE;
else
return FALSE;
}
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
When I try to modify the afxcore.rtf or afxprint.rtf for any reason, for example, I try to replace <<your app="">> with the name of my app the modified rtf file won't compile. Help workshop gives a couple of compile errors when I compile the hlp this way.
I open the files as rtf's in Word and save them in Word.
Anyone else out there have this happen?
Is it a MVC++ problem?
|
|
|
|
|
1) What are the errors?
2) Are you sure you're saving the files in Rich Text format, not Word's native format?
|
|
|
|
|
All,
I am working on a project to simulate a Jungle using C++. Being a 'non-graphics' coder, I am having a hard time envisioning a nice, easy way to graphically represent this Jungle simulation.
A little background:
The Jungle contains a few different kinds of animals which Move, Attack, Defend, Breed, etc.
The Jungle must be a simulation of the interaction of the animals...2-dimensional is recommended
Now, I am OK on the code for the interaction and the storage of the classes and all that...but, since I am a 'non-graphics' coder, what would you all suggest the 'best' option for me to graphically simulate these 'animals' (i.e. E's for elephants, M's for monkeys) moving around in this Jungle (in Windows, using Visual Studio 6, C++).
I could technically work with an array of characters that changes as the symbols that represent the animals move around, fight, breed, etc and simply print that to the standard console...but I am not sure how well ths works in a Windows Console. I know with Unix, I could use cursors or something like that to make it look nice (doesnt just continually scroll and display, scroll and display each time a day goes by in this sim). Is this the easiest option? Will this become a factor after a long enough running simulation (like 1000 sim-days of movement/breeding/fighting)
Is there a better way with forms/panels/datagrids? I am simply looking for suggestions on how to best use VC++ and Visual Studio to show the symbols moving around in a grid-like (2-dimensional) environment that wont cause me huge headaches and that is relatively simple to develop. I dont have all the time in the world .
Any input is greatly appreciated. Thanks!!!!
Casper
|
|
|
|