|
Does the problem persist if you use GetOpenFileName() instead?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Here's an idea...
Look at the beginning of the class definition for CFileDialog...
class CFileDialog : public CCommonDialog
{
DECLARE_DYNAMIC(CFileDialog)
public:
// Attributes
OPENFILENAME m_ofn; // open file parameter block
Whoa! There's an OPENFILENAME m_ofn member variable, and YOU DO NOT CONTROL IT'S SIZE!
You would have to rebuild your MFC DLL or rebuild the static MFC library to which you are linking, using the NEW size. Anyway, that is why you get the crash - you write to data that overwrites something else!
If you really need these new fields, you are going to have to 'swipe' the CFileDialog source code and make your own using the new data structure. Otherwise, just use OpenFileName as David Crow suggests.
|
|
|
|
|
First, my project is too large and I don't want to go and replace everything with OpenFileName().
Second, when I have to define _WIN32_WINNT to 0x0501 because I need it to use other functions that are define like
<br />
#if (_WIN32_WINNT >= 0x0500)<br />
#endif<br />
so OPENFILENAME will have the extra three data members. If Platform SDK provides me this (actually) new structure doesn't it also provide the necessary lib? Because of my settings it should try to link first to SDK libs and only after (if not found) to VS6.0 old libs.
|
|
|
|
|
does anyone know how to communicate with the Windows MIDI driver thru USB.???
|
|
|
|
|
Hello,
I am developing a DLL on eVC++ 4.0 in order to call some complex API functions through VS.NET 2003. But, VS.NET 2003 is generating an error at below;
An unhandled exception of type 'System.MissingMethodException' occurred in tester.exe
It is an WCE MFC AppWizard (dll) project. I cannot call even simple function. Sample code at below;
EXTERN_C
__declspec(dllexport)
int Tester(int a, int b)
{
return(a+b);
}
VS.NET code is a "Smart Device Application";
Imports System.Runtime.InteropServices
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Declare Function Tester Lib "wtest.dll" (ByVal a As Integer, ByVal b As Integer) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim c As Integer
c = tester(1, 1)
End Sub
End Class
I can see the "Tester" function at dumpbin output. Also, I declared "Tester" in .def file at below;
; wtest.def : Declares the module parameters for the DLL.
LIBRARY "WTEST"
;DESCRIPTION 'WTEST Windows CE Dynamic Link Library'
EXPORTS
Tester
; Explicit exports can go here
What do you suggest about this problem?
Regards,
Orkun GEDiK
SAP R/3 Software & System Support Specialist
ASTRON
|
|
|
|
|
I was reading through an article by Jan
Visual C and C++ (General) Technical Articles
C++: Under the Hood
Jan Gray
March 1994
struct P {
int p1;
void pf(); // new
virtual void pvf(); // new
};
struct Q : P {
int q1;
void pf(); // overrides P::pf
void qf(); // new
void pvf(); // overrides P::pvf
virtual void qvf(); // new
};
Most C++ implementations will share or reuse an inherited base’s vfptr. Here Q did not receive an additional vfptr to address a table for its new virtual function qvf(). Instead, a qvf entry is appended to the end of P’s vftable layout. In this way, single inheritance remains inexpensive. Once an instance has a vfptr it doesn’t need another one. New derived classes can introduce yet more virtual functions, and their vftable entries are simply appended to the end of their one per-class vftable.
Does that mean Q will use P's vftable? If both P and Q share the same vftable?
I could not get exactly if some one can help me understand that properly?
|
|
|
|
|
I have a wrapper function generated by the ClassWizard from a type library which goes like this.
<br />
VARIANT ClassA::GetSession(const VARIANT& varItem)<br />
{<br />
VARIANT result;<br />
static BYTE parms[] = VTS_VARIANT;<br />
InvokeHelper(0x7dd, DISPATCH_METHOD, VT_VARIANT, (void*)&result, parms,<br />
&varItem);<br />
return result;<br />
}<br />
I result is an object of ClassB. How do I convert the VARIANT to an object of ClassB and call it's methods ?
|
|
|
|
|
Hi,
I'm trying to use the IShellFolder::GetDisplayNameOf method to get the filename in a drag drop application. But the function behaviour is dependent on the display settings of folders. When i choose to hide file extensions for known filetypes it creates problems and returns only the filename(no extension) and if i choose to display extensions for all files i get the filename with extension.
Can someone please tell me how to get rid of this behaviour i.e. get the filename with extension no matter what the folder displayt settings are.
Thanks in advance,
DS
|
|
|
|
|
Digvijay Singh Chauhan wrote:
I'm trying to use the IShellFolder::GetDisplayNameOf method to get the filename in a drag drop application. But the function behaviour is dependent on the display settings of folders. When i choose to hide file extensions for known filetypes it creates problems and returns only the filename(no extension) and if i choose to display extensions for all files i get the filename with extension.
I would think this to be intended behavior as that is what "display name" implies. If the shell has been configured to hide the file extension, shouldn't the interface respect the setting?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How do I do to make CListCtrl cells bigger in height? I want them for e.g. to be 20 pixels.
_____________________________
...and justice for all
APe
|
|
|
|
|
You will need to make the control owner-draw and then you can use WM_MEASUREITEM to return the size with the appropriate height set.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
You mean I should overload the:
CWnd::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
function?
I've tried it but the function never seams to be called...
_____________________________
...and justice for all
APe
|
|
|
|
|
Have you changed the control to owner-draw?
Do you also realise that you will have to draw the items in the list control yourself too!?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Do I select the CListCtrl to be "an owner-draw control" by selecting that in the Properties window in the recource view? Is that "the thing to do" if I want to overrride functions like CListCtrl::DrawItem()?
_____________________________
...and justice for all
APe
|
|
|
|
|
Yes. If you look here at cp you will find quite a few owner-draw controls based on CListCtrl. They may be of some help if this is the first one that you are doing.
Good luck!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Tnx for help. I'll try to find some artickles about custom draw.
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi, i have the following problem:
In my application (.NET) the user can plug in an USB-drive and the software starts with a download from this drive automatically. After downloading I will stop this USB-drive, so that the user can pull out the USB-drive immediately.
Please help me!
Thanks!
Rolf
|
|
|
|
|
Hi~~~~ guys
I really want to know how to make a table editor
I am tring to use RichEditCtrl in order to insert tables in editor program, but I really don't know about that. I have no idea about that!
I am goint to die!!!!!!!
please tell me your advise
have a nice day
cheers~~~~~~
^____________^
|
|
|
|
|
now,i'm writing mdi application.
my demo application using tab control.(not mdi tab)
tab control create with static control for display image.
When i start run demo,images is load.
next, i want to change another image while demo is running.
following code i using ....it is not ok..
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void CMyView::OnApply()
{
CMy_TabDlg *dlg = new CMy_TabDlg;
if (!dlg->Create(IDD_My_DLG, this))
return;
else
dlg->Load_samplephoto("image/none.bmp");
}
|
|
|
|
|
Hi,
I seem to have a problem with linking an MFC application.
I get the following errors:
error LNK2001: unresolved external symbol __imp__floor
error LNK2001: unresolved external symbol __imp__atof
error LNK2001: unresolved external symbol __imp__atof
Am i forgetting a library to link with or what could cause this problem?
Best regards,
Jens
|
|
|
|
|
|
HI
How can I enter only numeric value in Edit Box
I checked its Property Numeric , but i cannot allow
value with decimal like 34.45
i not want to enter alphabets characters in it , how can i handle or do it
thanx
Regards.
|
|
|
|
|
Hi,
You run a loop and check the ASCII value of the charter entered into that edit box. If the value is falling between 97 - 122 (means user is trying to enter some alphabets using lower case), if the value is falling between 65 - 90 (means user is trying to enter some alphabets using upper case). Here you can give the appropriate message.
Bye....
|
|
|
|
|
I got the idea from your reply thanx
I want to check the ASCII value as i press key from key board that is it
a vlid key pressed .
Where can i catch / check that key pressed event fired on Edit Box .
thanx
Regards.
|
|
|
|
|