|
How difficult would this be and are they're any tutorials floatiing around which I could use as a guide...???
I thinking of deriving my already derived class from CDragListBox
The only catch is this...
I need to be able to drag items to new locations and items over top of other CWnd derived windows...???
Will using CDragListBox allow me to accomplish this...?
Thanx !!!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
|
Something is wrong with the link, make copy and paste it in your browser!
Sunny
|
|
|
|
|
I realize this is a pretty vague discription of a problem, but thought it might ring a bell with some of you...
I created an MDI application, serialized the data, and everything was going well. Then I tried some hostile testing by incrementing the schema version number, and instead of the CArchive object catching the difference, and presenting me with the "document out of date" dialog box (or words to that effect), the document loaded an older version of the data, and proceded to crash. Having just returned to Windows development, I thought this might be symptomatic of a setup problem of the serialized objects. It's obvious that the schema is being saved, since I can successfully load the saved document if I change the schema back to the original value. I even tried to catch a CArchiveException, but to no avail... Anything come to mind? I verified that the methods used paralled those in Scribble, but for all I know, I might be missing a vital ingredient.
Thanks.
If more information is needed, I can provide it, but thought this might be symptomatic of an obvious setup problem. Obvious to everyone but me!
|
|
|
|
|
There's a flaw, in that if you have a base class and there are derived classes, retrieving the schema in the base and derived class serialize methods will cause a problem.
I typically code around this by not using the MFC concept of schemas, and in each call to serialize, emitting a version byte. It sounds like overkill (and with a lot of objects, can inflate the amount of disk required), but it's not failed me yet.
This lets me always write using the latest version, but read any with code like;
if (ar.IsLoading())
{
BYTE version;
ar >> version;
// Do stuff that hasn't changed...
...
if (version > MAXOBJVERSION)
{
// throw a CArchive exception here!
}
if (version > 0x01)
{
// Do version 2 and later stuff...
}
}
Steve S
[This signature space available for rent]
|
|
|
|
|
how to uninstall a software programatically ?
r00d0034@yahoo.com
|
|
|
|
|
if the software appears in add/remove program then you can go to registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
and look for uninstallString key. That is the command line when you uninstall the software
hope this helps
Abdullah R
|
|
|
|
|
how to creat a setup project that will install an application through a wizerd ?
how to creat DNS programatically (driver name that we manually make in DB projects)?
how to logoff and login programatically ?
r00d0034@yahoo.com
|
|
|
|
|
imran_rafique wrote:
how to creat a setup project that will install an application through a wizerd ?
Use a setup creation software like InstallShield, Wise or a free Inno Setup[^].
Pavel
Sonork 100.15206
|
|
|
|
|
Hello @all!
How can I program a if-queries, whether a dialog still exists?
Lucky
|
|
|
|
|
You could use function IsWindowVisible() to determine if the dialog box is visible and in general can check its status. Otherwise, you coud set a boolean variable the parent class could call to get the status of the dialog box class.
Kuphryn
|
|
|
|
|
Thanks....the idea with the boolean variable is perfekt.
Lucky
|
|
|
|
|
[Sorry for my english]
Hi, i don't know if this question has been posted before.
I'm trying to make a simple calculator in Visual C (typical exercise of visual basic).
The problem is I would like to use only one function to all of the numerical buttons (those that simply adds a number to the display).
This is a problem more common that it seems, many controls and only one function for handling them.
How the function could know what button has called it?
thanks!
|
|
|
|
|
It all depends on how you are implementing your calculator.
If you are using MFC or WTL, you can make the click event for each button on your calculator call the same handler function and test the ID of the button in order to know which button was pressed.
If you are using plain Win32 API, in your wndproc function, you can have each click event call the same function, and the function would also pass in the ID of the button that was clicked.
{By the way, your english is fine)
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
If you want an example, just mail me back, and I will send it to you
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
Hello,
I have a quick question regarding CFileDialog..
I have a SDI type app with a "Settings" dialog box.. I allow the user to click a browse button with in the settings dialog box and select a .wav file as a sound/alert setting (using CFileDialog). The problem is that when the user selects the .wav file my current working directory changes to the path of the .wav file, so, if I do a "save" behind the scenes it saves my document to the same directory as the wav file not the directory of my .exe.
How can I prevent the current working directory (my .exe dir) from being set to the CFileDialog directory??
Thanks,
Rob
|
|
|
|
|
How can I get the directory that the .exe sits in on startup?? GetCurrentDirectory will not work. Is there another way?
|
|
|
|
|
Give this a shot.
_TCHAR drive[_MAX_DRIVE];
_TCHAR dir[_MAX_DIR];
_TCHAR fname[_MAX_FNAME];
_TCHAR ext[_MAX_EXT];
_TCHAR path[_MAX_PATH];
::GetModuleFileName(NULL, path, _MAX_PATH);
_tsplitpath(path, drive, dir, fname, ext);
CString sFolder = CString(drive) + dir;
|
|
|
|
|
Perfect... Thanks a bunch!
Rob (Bonehead)
|
|
|
|
|
i know, i have posted this question some days ago ...
but this example :
CHARRANGE cr;
cr.cpMax = LONG_MAX;
cr.cpMin = LONG_MAX;
richedit.SetSel( cr ); // move selection to the bottom
richedit.ReplaceSel( (LPCSTR)string ); // insert your text
// force the rich edit to scroll to the bottom
richedit.SendMessage( SB_BOTTOM, NULL, NULL );
doesn't work correctly. (for richedit)
Maybe anybody else knows, how ara many clients prints channel text (mIRC, Client, etc... )
it would be better give some examples (full sources of small exampl-programs) ...
thanks
----------------------------
never stop coding.
|
|
|
|
|
sorry, the topic is "irc like textoutput" ... nevermind ..
----------------------------
never stop coding.
|
|
|
|
|
You could try this
CString strRecvd;
m_cRichEdit.GetWindowText(strRecvd);
if(strRecvd.IsEmpty())
m_wndMonitor.SetWindowText(strMessage);
else if(!strRecvd.Right(1).CompareNoCase("\n"))
m_cRichEdit.SetWindowText(strRecvd + strMessage);
else
m_cRichEdit.SetWindowText(strRecvd +"\n"+ strMessage );
m_cRichEdit.SetSel(-1, -1);
m_cRichEdit.SendMessage(EM_SCROLLCARET);
Hope it helps
Rob
|
|
|
|
|
Hello,
I'm trying to implement a CListCtrl that will add items from a database but for some reason (that I can't figure out) the CListCtrl is adding only blank strings. My code is as follows:
for (i = res.begin (); i != res.end (); i++) {
dateinfo = *i;
lvi.mask = LVIF_TEXT;
lvi.iItem = j++;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR) dateinfo["created"].c_str ();
m_listDate.InsertItem (&lvi);
} I've checked the lvi.pszText attribute of the LV_ITEM struct and it contains the string right before the call to CListCrtl.InsertItem .
Any ideas as to why blank strings are being added? Any help is much appreciated.
Thanks
- monrobot13
|
|
|
|
|
A quick addition to the stuff above. As you probably guessed I'm using the CListCtrl in report mode but if I use it in list mode and just use CListCtrl::InsertItem (int nItem, LPCTSTR lpszItem) the text inserts fine but it isn't one long list which is what I need. Just thought I'd let you all know that. As well if anyone knows a way to make a CListCtrl in list mode just have one long list (instead of scrolling sideways) I could just do that instead.
Thanks again.
- monrobot13
|
|
|
|
|