|
Does the update have a difference on owner-data, custom drawn list controls? The parent window gives the data to the control on LVN_GETDISPINFO notification. So, to initiate a paint, I call only the SetItemCount() or SetItemCountEx() function.
Btw, I am downloading the foobar. Looks great from the site.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
No, it shouldn't matter. Btw, to update the control, I just set the item text for the changed rows/columns.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Using the following:
VC++ 6.0/sp5
Win2K, Win95, and Win98
Our app uses some proprietary file formats and of course, the appropriate file types are associated with our app. However, when I double-click an associated file type, I get a message that is generate by windows that reads:
Cannot find the file "full path/name of file I clicked on" or one of it's
components. Make sure the path and filename are correct and that all
required libraries are available.
The path\filename are correct, and all of the required libraries are available. In fact, if I just load the app and open the very same file from within the app, it opens fine. Similarly, if I pass the desired filename in on the commandline, it opens fine. I can also drag a file onto the app window, and it will open without complaint.
At the top of OnInitInstance(), I have added the following code:
CString sCmdLine = ::GetCommandLine();
AfxMessageBox(sCmdLine);
The resulting string shows this (including all quote marks shown):
"D:\path\myprogram.exe" "
When I manually pass the filename in on the commandline, the same string shows this:
"D:\path\myprogram.exe" "D:\path\myfile.xyz"
What the heck is wrong here?
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
|
|
|
|
|
these are dumbass suggestions so dont yell at me for them being so
filename has no quote marks or wierd stuff in it?
filepath likewise?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
Everything looks good on the paths and filenames (as they show up in explorer).
Could something be funky in the registry?
Hmmmm....
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
|
|
|
|
|
maybe the file association links got trashed?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
John
How are you doing the association - and does the error happen with files with spaces in the name ?
If so the
shell\open\command default value might be this
<your app="" path=""> %1
try this
<your app="" path=""> "%1"
ensures that the spaces are treated as one full string instead of multiple files
also try
"<your app="" path="">" "%1"
if that doesn't work
|
|
|
|
|
Sorry that last message did't work quite right
John
How are you doing the association - and does the error happen with files with spaces in the name ?
If so the
shell\open\command default value might be this
<your app path> %1
try this
<your app path> "%1"
ensures that the spaces are treated as one full string instead of multiple files
also try
"<your app path>" "%1"
if that doesn't work
|
|
|
|
|
The problem may be in the registry. Look at the default value under HKEY_CLASSES_ROOT\.xyz (the value is noted <the_value> below).
Then look at the default value of the following key, that may be the cause of the problem:
HKEY_CLASSES_ROOT\<the_value>\shell\open\command
May be this string is just wrong (messed up quote or something).
I hope this helps,
David Defoort
|
|
|
|
|
I'm using Wise 9.1 for instalations, and for some reason, it's translating this:
"%MAINDIR%\myapp.exe" "%1"
to this (showing as it appears in the registry):
"D:\program files\mycompany\myapp\myapp.exe" "
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
|
|
|
|
|
adding another "%" to the original line fixed the basic problem, but I'm still getting this
Cannot find the file "full path/name of file I clicked on" or one of it's
components. Make sure the path and filename are correct and that all
required libraries are available.
weird.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
|
|
|
|
|
John Simmons / outlaw programmer wrote:
Cannot find the file "full path/name of file I clicked on" or one of it's components. Make sure the path and filename are correct and that all required libraries are available.
I know it has been a while, but did you ever find out what was causing this? I am having the same problem and it is driving me crazy.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Geeze - I'll have to go back and see what I did, and it will have to wait until tomorrow because that's work stuff, and I'm at home.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I've got a small SDI app. I have a bunch of settings I want to retain in between program loads. Where is the "proper" place to store them among the MFC classes that ClassWizard creates? Do I declare a struct in my CChildView class, or put it in CMainFrame?
On a more general note, if there's anybody that uses Sonork or ICQ or IRC and wouldn't mind me occasionally bugging them for a small finicky question like this every now and then, I'd appreciate the help. Until then I'll keep asking here and waiting patiently for CG to respond.
- Jason
(SonorkID 100.611)
"The sort of guy who'd give the kid an extra scoop of ice cream free if he was an ice-cream man"
- Nish, on Chris Maunder
|
|
|
|
|
I tend to make them either members of the document class or the app class depending on where they need to be used.
If there is a lot of them I will create a seperate class and have that be a member of the CDocument/CWinApp derived class.
Michael
|
|
|
|
|
Jason Hooper wrote:
settings I want to retain in between program loads
ummm ... the registry
when ur program exits nothing in the doc or whatever will be there
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
Yeah.. I didn't explain myself correctly. I plan to use the registry anyway, but I just wonder where the best place is to put the settings after I pull them from the registry.
- Jason
(SonorkID 100.611)
"The sort of guy who'd give the kid an extra scoop of ice cream free if he was an ice-cream man"
- Nish, on Chris Maunder
|
|
|
|
|
I tend to place the view specific settings in the View class and the document specific settings in the Doc class. And any setting that is common to all views/docs (if it is an MDI), in the App or MainFrame.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
errrrr
oooops
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
How do we feel about directly calling framework handlers?
I'm talking about setting up a DC and calling OnPaint(). I'm talking about calling the WM_COMMAND handler for a specific menu item.
Personally, I find this quite lazy. What should be done it to create a routine that does the required action, and then have both the framework handler and the user code call the routine.
Am I psycho?
J
|
|
|
|
|
ummmmm
maybe u should change ur name to jamie bates?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
lauren wrote:
ummmmm
maybe u should change ur name to jamie bates?
That would be a "yes" then?
J
|
|
|
|
|
Somehow, I find this a little less elegant.
Works nevertheless
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I think that it is fine, as long as only your class can call the framework handlers directly. The way that I look at it, is you are combining common functionality into one place. That common code needs to be accessed.
Do what makes the most sense for the situation. Whether it is sending a message to the window and letting the message handlers process the message, or calling the framework handler directly.
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!
|
|
|
|
|
Hi !
In my current MFC source code, I have two classes, the usual "MainDlg" and .. euhm ..let´s say "A", which is not a CDialog based class, but another kind of class running separately (in its own thread). In a function of A, I send a message with PostMessage(MSG_MYMESSAGE,35,47); and I´d like to get it in my MainDlg. A way to do this is to declare :
<br />
BEGIN_MESSAGE_MAP(CMainDlg, CDialog)<br />
ON_MESSAGE(MSG_MYMESSAGE, OnMyMessage)<br />
END_MESSAGE_MAP()<br />
This triggers the OnMyMessage() function, but i do not know where to find my two parameters 35 and 47 (that is, the WPARAM and LPARAM), and I really need them.
So, is there any way to get these parameters ?
Thanks 4 your help.
RaGe
Unfortunately, brute-force solutions tend to be slow
even when performed by modern-day microcomputers,
which are capable of several MIPS except when I'm late
for an appointment and want to finish a compile and
run just one more test before I leave, in which case
the crystal in my computer is apparently designed to
automatically revert to 1 Hz.
-- Michael Abrash
|
|
|
|