|
There's no possibility of the conflict. Parent's handler will be called only if both conditions are true:
1) code member of NMHDR is equal to 1st parameter of ON_NOTIFY
2) idFrom member of NMHDR is equal to 2dn parameter of ON_NOTIFY
In fact, you can use any value as code. However, it would be a good practice to avoid range of codes starting with NM_FIRST and NM_LAST. In this range you'll find some general-purpose codes, like NM_CLICK. I think you should use NM_LAST+1, NM_LAST+2 etc. for your notification codes.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have a problem and I don't know what to do !!!! I'm trying to learn but the compiler don't help me !!!!
My code:
#import "msado15.dll" no_namespace rename( "EOF", "adoEOF" )
#import "msadox.dll"
And I get:
msadox.tlh(98) : error C2011: '_Collection' : 'struct' type redefinition
(... Thousands of sentences like the one above ...)
What am I doing wrong ??? Why is redefiniting everything if they're different libraries ??? What sould I do ????
|
|
|
|
|
I don't know, I'm using the same line than you to load msado15.dll but i don't have this problem.
you can try this (maybe you import it more than once
#if !defined __MY_IMPORT_OF_MSADO15_DLL__
#define __MY_IMPORT_OF_MSADO15_DLL__
#import "msado15.dll" no_namespace rename( "EOF", "adoEOF" )
#endif
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
No, it's not that !!!!
The problem is that msadox.dll and msado15.dll have some of the same collections defined and this is why they get redefined !!!!! How can I solve it ??????
|
|
|
|
|
Import the dlls in diferent Files.
Use the ado functions in a file, and the adox functions in other one.
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Yes, if I use that everything goes OK, but the problem is that I have two classes (one using msado15.dll and the other using msadox.dll) and I want them to share the connection, so I thought of passing the ConnectionPtr from one class to the other. Otherwise, I've to do two different connections to the same source and It's not very efficient.
I found this in msdn:
// BeginCloseConnectionCpp
#import "c:\Program Files\Common Files\system\ado\msadox.dll" \
no_namespace
#import "c:\Program Files\Common Files\system\ado\msado15.dll"
and in a function:
m_pCatalog->PutActiveConnection(_variant_t((IDispatch *)m_pCnn));
where m_pCnn is a ConnectionPtr
That's what I want to do !!!!!
|
|
|
|
|
CString strTest;
strTest.LoadString(IDS_Test); // IDS_Test == "Hello, world!"
cout << strTest << "\n";
output: "0077046C"
this is not exactly what i expected...can somebody help?
|
|
|
|
|
This code comes from VC++ Wizard, Console App with MFC support
CString strHello;
strHello.LoadString(IDS_HELLO);
cout << (LPCTSTR)strHello << endl;
|
|
|
|
|
ok, and what does (LPCTSTR) in front of "strHello" means?
to convert the string into that type?
|
|
|
|
|
It means that you should pick up a book and read.
|
|
|
|
|
LOL )) good one!
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
SShhh:
I will say you a secret.
LPCTSTR is a 32-bit pointer to a constant character string.
Best regards!!!
Carlos Antollini.
|
|
|
|
|
I think the exect translation is:
L - Long
P - Pointer
C - Const
T - (somthing (could be TCHAR (I don't remember)))
S \
T = - Str
R /
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
correction:
==========
I think the exect translation is:
L - Long
P - Pointer
C - Char
T - (somthing)
S \
T = - Str
R /
LPCTSTR = const char *
LPCSTR = char *
I think
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
Nope, the first one was correct: Long Pointer to Const Tchar String
in WinNT.h: (well, this isn't directly transcript, but you'll get the idea)
#ifdef UNICODE
typedef wchar_t WCHAR;
typedef CONST WCHAR *LPCWSTR;
typedef WCHAR *LPWSTR;
typedef WCHAR TCHAR;
typedef LPCWSTR LPCTSTR;
typdef LPWSTR LPTSTR;
#else
typedef char CHAR;
typedef CONST CHAR *LPCSTR;
typedef CHAR *LPSTR;
typedef CHAR TCHAR;
typedef LPCSTR LPCTSTR;
typedef LPSTR LPTSTR;
#endif
not that it really matters in the long run
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
You can use
CString strTest((LPCTSTR)IDS_TEST);
cout << (LPCTSTR)strTest << "\n";
Cheers!!!
Carlos Antollini.
|
|
|
|
|
My first question is : How to start a SnapIn Project for MMC without thus using ATL therefore without starting a project by ATL COM AppWizard + Insert | New ATL Object -> MMC SnapIn?
MMC Design and Developper kit book of Microsoft Press does not explain that.
My Second question is : How to define or choose the value of _T_CCF_INTERNAL_SNAPIN of CDataObject? Is it arbitrary?
Thanks a lot!
|
|
|
|
|
If you do not want to use the ATL MMC SNAPIN object, get a sample from the MS platform SDK and use that as a skeleton.
I programmed snap-ins using ATL, normal COM and also COM + MFC
ATL was my worst experience. Full of bugs, very inflexible, not documented... - I do not recommend it...
Plain COM was a pain because of message maps etc.. but it worked very well and gave me good control.
MFC was the fastest to deploy but took more playing around to get it working at first. It offered the same control as plain COM.
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
Another question :
I have difficulty in understand the utility and the way in which Microsoft initializes GUID.
I looked at the samples codes of Microsoft and various GUID are initialized in this way:
const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
or
const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
or
const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
So, if I want to add new item, how I initialize GUID of the class of item ?
const GUID NEWCItem::thiscGuid = {??????? };
const GUID NEWCItemcFolder::thiscGuid = {??????? };
|
|
|
|
|
I use UUIDGEN.EXE to get the GUID:
F:\Platform SDK\Bin>uuidgen -s
output:
INTERFACENAME = { /* 46070c72-0b89-48fc-9770-bed9ff193daa */
0x46070c72,
0x0b89,
0x48fc,
{0x97, 0x70, 0xbe, 0xd9, 0xff, 0x19, 0x3d, 0xaa}
};
in your code, replace INTERFACENAME with this: const GUID NEWCItem::thiscGuid
So you will get this:
NEWCItem::thiscGuid = { /* 46070c72-0b89-48fc-9770-bed9ff193daa */
0x46070c72,
0x0b89,
0x48fc,
{0x97, 0x70, 0xbe, 0xd9, 0xff, 0x19, 0x3d, 0xaa}
};
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
hi,
I have a menu with ID "IDR_MENU", now i want to load it dynamically at the "right side" or "left side" of a dialog box in VC++. Is there any CWnd function or any other help....I can load it at the "right side " of dialog by setting menu properties "Right to Left order Allignment", but i want to do this at run time.
Have a nice wishes for helper.
|
|
|
|
|
If this menu is in the menu bar, like File, Edit, View, etc. you are stuck with the window layout that comes with your locale settings, i.e. left to right. You would have to switch locals to get something different.
If this ia a popup menu you can use the TrackPopupMenu function to tell it where to popup. Or if you are creating the menu dynamically you can of course give it an initial location.
|
|
|
|
|
Set the MF_RIGHTJUSTIFY flag for the first top-level item in the menu. That'll move all top-level items on the right edge of the frame. This will look weird, since it's not the standard behavior, but there ya go.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
"MF_RIGHTJUSTIFY " how I can set this Flag of already created menu. which Function is responsible for this settings.
This can be set when menu is designed but i want to make this change at run time.
The Actual problem is
The interface of application is in different languages. and I have to decide at run time the position of menu
|
|
|
|
|
Assuming menu is a CMenu object representing the top-level menu, this ought to do it:
menu.ModifyMenu ( 0, MF_BYPOSITION | MF_RIGHTJUSTIFY );
I haven't tested this, but it sounds right.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|