|
I have an SDI app that supports 1 data fileformat.
I would like to add support for a custom image format in a way
that enables users to double click these image files in windows and the program will show these in a simple frame. I don't want to Edit/Save these image files, just register the filetype & show them.
When my app starts normally it should use the standard original doctemplate.
(not ask: New format A, or new Format b etc) I tried messing around with CMultiDocTemplate, but that doesn't seem to be quite it. Any suggestions on how to go about this one?
I think I should have a doctemplate with a CFrameWnd&CView (all basic behaviour), but should it be 2x single? Multi but not add the 2nd one?
Thanks!
|
|
|
|
|
how can i make my open file dialog to select a single DIRECTORY and FOLDERS ONLY?
and if the directory does not exist, enter the name at the edit box and create it?
here's my code:
int nRetCode = 0;
CString sFilePath;
CFileDialog fdlg(
TRUE,
NULL,
NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
NULL,
NULL
);
//Check to see if the selected item is installation folder. If so, launch the open file dialog.
int index_selected = this->m_lvSettingList.GetNextItem(-1, LVNI_SELECTED);
//Launch open file dialog:
if(index_selected==0)
{
nRetCode = fdlg.DoModal();
this->m_strInstallDir = fdlg.GetPathName();
UpdateData(TRUE);
this->m_lvSettingList.SetItemText(0, 1, sFilePath);
UpdateData(FALSE);
}
norm
|
|
|
|
|
You may take a look at this question in Mike's FAQ.
Hope this helps.
~RaGE();
|
|
|
|
|
thanks, just downloaded a sample from code guru
http://www.codeguru.com/dialog/folder_dialog.shtml
not sure if it's free for commercial dev however.
norm
|
|
|
|
|
Hi !!
My app, developped with VC++6 creates a window. I want the window to be invisible, so I create it with the style SW_HIDE. It works, the window is not shown, but it remains in the taskbar (or whatever the correct name is : on the right side of the Start button, where each apps has a button with its name).
I don't want to see anything of my window, neither on the screen nor on the taskbar.
How can I do that ?
Thank you for your help !
Jerome
|
|
|
|
|
|
Thanks for the link ! Very interessant stuff !
Jerome
|
|
|
|
|
I'm creating a program that allows multiple uploads and downloads between two computers. I want to create a similar interface to the one found in LeechFTP. Hopefully someone out there is familiar with it. Using Spy++ it's apparent that the upload/download list is not a window itself. I can think of about a million ways to implement this, but was wondering what everyone else has to say about it. For those of you who haven't seen LeechFTP, it has a list of the current uploads and downloads with a progress bar and static text info for each thread. I'm also curious as to what's going on behind the scene. In my version I have a vector that holds classes that represent each upload/download in progress. Should each of these classes be able to draw the progress bar w/ static text info? How would I make this list scrollable?
Thanks for any suggestions!
-Michael Anderson- 完成の円
|
|
|
|
|
I would like to create a program that uses one document and uses multiple views to it. The document needs to get into dialog boxes and I am having a dificult time getting the document into them. How does one access the single document when creating a new view?
Cheers,
Clint
PS. Please let me know if the above doesn't make sense.
|
|
|
|
|
You can create multiple views that all refer to the same document.
Just register multiple CMultiDocTemplates in your CWinApp::OnInitInstance
method refering to different views.
To make the views "dialogish", inherit from CFormView.
I hope these pointer help.
Iain Clarke.
|
|
|
|
|
I think this is a good start... Some clarifying though please. Do I need to make my application be a multidoc app? Currently it is just a single doc because that is what I wanted it to be. How do I get the views to refer to the same document? Do I need to pass an initialized variable or something? Do you know of any examples that I could dissect?
Thanks,
Clint
|
|
|
|
|
I've read somewhere that in VC++7.0, if we use CString class then there is no need to link our aplication with MFC. Is it true ???
If yes, then what we have to do in order to use it in our console app, not using MFC
|
|
|
|
|
CString as well as some others are part of 'shared' classes which are shared between MFC and ATL. So yes, you don't need MFC for CString - ATL is enough.
|
|
|
|
|
This is also true (kind of!) for VC++ 6.0, since you can get the WTL 3.1 stuff (from MSDN, do a search on downloads for WTL) and that too has a CString implementation which is non-MFC.
Make sure you have 3.1, not 3.0, as there are some bug fixes (Replace works when the replacement string is a different length to the source section).
Steve S
[This signature space available for rent]
|
|
|
|
|
In my dialog function as following, the key_board input wouldn't get response, why?
BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message) {
case WM_INITDIALOG:
.....
return TRUE;
case WM_CHAR:
switch(wParam)
{
case '1':
record_data_pair(1);
break;
case '2':
record_data_pair(2);
break;
case '3':
record_data_pair(3);
break;
default:
break;
}
return TRUE;
}
default:
return FALSE;
}
Thanks
Sean
|
|
|
|
|
hi
maybe you havn't called TranslateMessage in your message loop. you know what's message loop, yes? any way this is a simple message loop:
while(GetMessage(...)) {
TranslateMessage(...);
DispatchMessage(...);
}
hope it helps
|
|
|
|
|
NO, I guess you misunderstood the question.
The code I posted is a callback function of a DIALOG, which is launched by the main window. i.e, that's not the main window's callback function.
I have TranslateMessage in my WinMain() function.
Any idea about this situation?
Thanks
Sean
|
|
|
|
|
The only other recommendation is to debug the thing and check to see if it's even going into the function at all, when you press a key.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I have had some recent success with the CListView control but I am still having problems. How do I automaticly resize the ListView so I can have a status bar in the program? I tried it manually, but the windows XP status bar is a different size than the Windows 9x/2k status bar. Is there prehaps a GetSystemMetrics() parameter I can use?
-- Steve
|
|
|
|
|
Is it thread-safe?
I'm guessing yes...
I'm hoping yes as well...
J
May the bear never have cause to eat you.
|
|
|
|
|
Nope.
One thread could call SetRegistryKey
while you were happily using the GetProfileInt method.
For most practical purposes though, yes.
|
|
|
|
|
Hey all,
I was wondering.
I created an ActiveX that is used within an IE page.
In that ActiveX, I call URLDownloadToFile.
I am supposed to pass "a pointer to the controlling IUnknown interface of the calling ActiveX component" in the first parameter.
Currently, I pass NULL and it seems to work just fine.
Can you please tell me WHY I am asked to pass a pointer to that IUnknown interface, and what might happen if I pass NULL?
Thanks in advance!
|
|
|
|
|
By doing EnumWindowCallBack and then EnumProcessModules and then
GetModuleBaseName etc I can obtain names of all/or at least most processes running on my computer.
By comparing the name against IEXPLORE.EXE or something like that I can determine if the process is Internet Explorer.
Once I have found an instance of IE running, is there a way to determine which web server/site it is connected to? Also is there a way to get access to the HTML/Source in the browser?
Thanks
|
|
|
|
|
I am having a problem with a multidimensional CArray. It is as follows:
header.h
typedef CArray<cpoint, cpoint=""> TRAIL_PATH;
typedef CArray<trail_path, trail_path=""> MULTI_TRAIL_PATH;
source.cpp
TRAIL_PATH path;
MULTI_TRAIL_PATH mpath
CPoint point;
...
path.Add(point);
...
mpath.Add(path); <- Error (see below)
...
error C2664: 'Add' : cannot convert parameter 1 from 'class CArray<class cpoint,class="" cpoint="">' to 'class CArray<class cpoint,class="" cpoint="">'
No copy constructor available for class 'CArray<class cpoint,class="" cpoint="">'
How do I properly create an array of arrays of structures?
Thanks,
Clint
|
|
|
|
|
the best way around this is to use std::vector. it is superior in all respects to CArray.
-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
|
|
|
|