|
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.
|
|
|
|
|
|
Hi,
I tried this but it not taking (.) Decimal ( point)
I want Decimal (point) there (.)
as 344.455 ;
but ES_NUMBER is entering it 344455;
waintg for reply
thanx
Regards.
|
|
|
|
|
Oops, sorry - my mistake. I assumed ES_NUMBER allows . too and you wanted the . to be disallowed
Do the same steps as I mentioned in the first post - except don't use the ES_NUMBER style. Now check the entered text in the EN_UPDATE handler and remove all characters other than numbers and .
Nish
My blog on C++/CLI, MFC/Win32, .NET - void Nish(char* szBlog);
My MVP tips, tricks and essays web site - www.voidnish.com
|
|
|
|
|
hi..
You need to derive a new class using CEdit as the base class. There you can code either OnKeydown() or OnChar(, or PreTranslateMessage() message to suit your needs.
For PreTranslateMessage() here is the code...Hope it'll help you
BOOL CMyEdit::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN )
{
int nVirtKey = (int) pMsg->wParam;
if(nVirtKey >= 97 && nVirtKey <= 122) //For Lower Case
{
MessageBox("Cannot enter alphabets");
}
if(nVirtKey >= 65 && nVirtKey <= 90) //For Upper Case
{
MessageBox("Cannot enter alphabets");
}
}
return CEdit::PreTranslateMessage(pMsg);
}
Bye...
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
Use a masked edit control.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello everyone.
When I release my mfc app. and I want to
Use this exe file in a Windows that haven't
Visual Studio Installed on it this file
give me an error there isn't a file to run...
Please help me on this.
Best Regards.
Thanks.
|
|
|
|
|
Hi...
I think you probably need to ship the supporting DLL's also required by your application. Check the Dll name that is appearing in the message box when u try to execute the application.
Bye...
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|