|
I'm not so sure I haven't misinterpreted your question.
However, do you have a specific requirement to create your own dialog to allow for file selection? I ask, because the first thing I thought when I saw your post was 'what about the GetOpenFileName[^] common dialog?'
|
|
|
|
|
I didn't see it in the toolbox.
I just assumed you had to write everything from scratch, oh well.
I'll check the Microsoft Social Forum tonight
|
|
|
|
|
Me too. (implemented drag-n-drop file-opening once since it seemed easier than writing a file selection dialog)
It's quite easy to use though - much easier than trying to implement your own.
Unfortunately, the 'equivalent' function for selecting folders doesn't give such an intuitive, easy-to-use dialog. I seem to remember some kind of trick involving the lpfnHook and a filter that will exclude all files that aren't directories.
|
|
|
|
|
It sounds like it's easier for me to just figure out the icon detail, and make the click events and functions. LOL!
I'm not that far away from completion, and besides, I can use the lesson for other listbox I have in the program. The multi-column thing is quite cool however, and I would like to get to know it better.
Thanks for the post, at least one person has interest in it!
Appreciate the help!
|
|
|
|
|
Worked on it for a couple of hours today. Documentation at MSDN is pretty vague, and got just 1 response off some post I made for help. Looks like SHGetFileInfo is very flexible in it's use, and can be used a dozen different ways.
I didn't see a pre-fabricated control or class in the toolbox, so I made this from scratch the hard way. So far so good.
If I'm completely off base here, just let me know. I might ditch the SHFILEINFO, I don't think I need it.
SHFILEINFOW siFI_Small = {0};
HIMAGELIST hSImageList = {0};
hSImageList = (HIMAGELIST)SHGetFileInfo( L"Doesn't matter", FILE_ATTRIBUTE_DIRECTORY, &siFI_Small, sizeof( siFI_Small ), SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES );
DeleteObject( siFI_Small.hIcon );
SHFILEINFOW siFI_Large = {0};
HIMAGELIST hLImageList = {0};
hLImageList = (HIMAGELIST)SHGetFileInfo( L"Doesn't matter", FILE_ATTRIBUTE_DIRECTORY, &siFI_Large, sizeof( siFI_Large ), SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES );
DeleteObject( siFI_Large.hIcon );
It looks like any combination works when adding the folder icon, which is index 1 in the imagelist.
lv_ProjectOpen_Item_Record.iItem = dwIndex;
lv_ProjectOpen_Item_Record.iSubItem = 0;
lv_ProjectOpen_Item_Record.mask = LVIF_IMAGE;
lv_ProjectOpen_Item_Record.iImage = 1;
lv_ProjectOpen_Item_Record.cchTextMax = 254;
ListView_InsertItem( lv_ProjectOpen_FileSelect, &lv_ProjectOpen_Item_Record );
lv_ProjectOpen_Item_Record.mask = LVIF_TEXT;
lv_ProjectOpen_Item_Record.pszText = szFileName;
ListView_SetItem( lv_ProjectOpen_FileSelect, &lv_ProjectOpen_Item_Record);
|
|
|
|
|
hi
any body help me or guide me from where i start to read flash drive type reader.
thanks.
|
|
|
|
|
Try using Google[^] first.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Is the USB device mounted, and does it have a drive letter assigned to it?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
please, some one give me documentation about c++ gui.
thinks
|
|
|
|
|
|
documentation about graphical user interface(winForms). ( my project in visual studio 2010 os:windows 7)
|
|
|
|
|
What documentation are you talking about? If you want to write Windows programs in C++ then there are plenty of articles here on CodeProject and elsewhere that can help you. If you are looking for something else then please be more explicit about your problem.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
You already have Google, MSDN, CodeProject, etc...
Veni, vidi, vici.
|
|
|
|
|
i have created an extension dll. where i am loading a dialog from the client mfc application. My dialog has all menubar, toolbar, view. the dll dialog is being loaded but the toolbar is not coming. toolbar is there of the client mfc applications toolbar. My dll dialog toolbar is not being shown. any suggestions what could be the problem??? Thanks in advance
[code]
BOOL CDlgsViewDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_pNewView = new CMyView();
ShowWindow(SW_SHOWMAXIMIZED);
CRect clientRect;
GetClientRect(&clientRect);
clientRect.DeflateRect(10, 30);
// Creation of the view window
if(! m_pNewView->Create(NULL, NULL, WS_VISIBLE | WS_CHILD, clientRect,
this, WM_USER))
{
MessageBox(L"Failed to create view");
}
menu.LoadMenu(IDR_MAINFRAME1);
SetMenu(&menu);
if(!m_FirstToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD |
WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_FirstToolBar.LoadToolBar(IDR_TOOLBAR1))
{
EndDialog(IDCANCEL);
}
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0);
m_wndStatusBar.Create(this); //We create the status bar
m_wndStatusBar.SetIndicators(indicators,2); //Set the number of panes
CRect rect;
GetClientRect(&rect);
//Size the two panes
m_wndStatusBar.SetPaneInfo(0,ID_INDICATOR_NISH,
SBPS_NORMAL,rect.Width()-100);
m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_TIME,SBPS_STRETCH ,0);
//This is where we actually draw it on the screen
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,
ID_INDICATOR_TIME);
m_wndStatusBar.SetPaneText(0,L"MainWindow Initialized");
if(!fileName.IsEmpty()) {
m_pNewView->loadProfile(fileName);
m_pNewView->domainSetUpForProfile();
m_pNewView->drawLines();
m_pNewView->drawArcs();
m_pNewView->drawProfile();
m_pNewView->isModel=true;
m_pNewView->OnGeneratesurface();
m_pNewView->OnShade();
m_pNewView->OnIsosouthwest();
}
return TRUE; // return TRUE unless you set the focus to a control
}
[\code]
This is the OnInitDialog of my dll dialog where i am loading everything menubar, toolbar calliing some functions etc.
Please help
|
|
|
|
|
This looks like a very complicated way to start a Windows application. Why not just use the standard Framework - View model that has been used since Windows first appeared?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I want to call this dialog from another mfc application, it loads fine working properly. only the toolbar is not coming.
|
|
|
|
|
It's difficult to suggest anything but it may have something to do with the RepositionBars() calls. You should try a bit of debugging to see what is happening at each step in this function.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I wanna to print
utf-8 string in cmd via C++/C.
How ?
|
|
|
|
|
Your question is not very clear, please try and add some more detail. Or do you just mean that you want to use a printf() statement in a console application?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I have this code in C++ but it give the error:
Please Help :
#include <iostream>
#include <conio.h>
#include<string.h>
#include<fstream>
#include <sstream>
#include<wchar.h>
using namespace std;
int main( void )
{
char ch;
wchar_t c;
wstringstream o;
wstring wstrIn;
const char* pFile="test.txt";
FILE* in;
in=fopen (pFile,"rb");
if(!in)
{
cout<<"Error."<<endl;
exit(0);
}
int i=0;
int len=sizeof(wchar_t);
c=fgetwc(in);
while(c!=0xFFFF)
{
c=fgetwc(in);
o<<c;
}
wstrIn=o.str();
fclose(in);
getch();
}
The Error Is :
`wstringstream' undeclared (first use this function)
|
|
|
|
|
What compiler are you using?
Why are you mixing 'old style' headers with new ones?
Veni, vidi, vici.
|
|
|
|
|
I am Using
Bloodshed Dev-C++<br /> for compiling . So Plz Help.
Thanks for Reply.
|
|
|
|
|
MingW (used by Dev C++ ) had issues with wstringstream (see, for instance, here[^]). I don't know if they are fixed now (and I don't know which version you have).
You may also try a different IDE , like Visual C++ Express Edition[^].
Veni, vidi, vici.
|
|
|
|
|
#include "iostream"
int main(int argc, char* argv[])
{
std::cout << "utf-8 string in cmd";
return 0;
}
Independent ACN Business Owner- Check out the possibilities for your future!
- Financial independance
- Full time or Part time
- In more than 20 countries through North America, Europe, Asia and the Pacific
- Featuring the ACN IRIS 5000 video phone. See the person you are talking to.
Within you lies the power for good - Use it!
|
|
|
|
|
<pre lang="c++"><code>
#include "iostream"
int main(int argc, char* argv[])
{
std::cout << "سلام";
return 0;
}</code>
No use!
Please Help.
|
|
|
|