|
i have tried it with other formats but actually as i am using loadimage to load HBITMAP and this function does not work with other formats thatswhy this example is not working with other type of images.
still i could not find a way to load my HBITMAP for other formats..
|
|
|
|
|
What are the possibilities to remove the MFC dependency, from an MFC extension DLL?
Means, the interface class cannot have MFC dependency, but no need to remove MFC from internal code (functionality side). I believe it is not possible, but i would like to know your opinions
For example, my extension dll has a custom button (named CCustomBtn) derived from CButton. In the client side, CCustomBtn is used to create control variable for the button to get the custom look and feel. So what I need is, avoid the MFC dependancy from this CCustomBtn class (and in the include header), with/without affecting the client side. ('without affecting' is preferred, but i think it is impossible)
Please share your ideas.
Thank you.
- NS -
|
|
|
|
|
If you have a class derived from an MFC class then everywhere you use that
class will have a dependency on MFC.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes. But my requirement is to use the same dll for both old vc6 projects and for new vc8/9 projects. So there is an option to avoid the MFC dependency. As far as I know, extension dll should be compiled using the same compiler and libraries those are to be used for the client side. So if there is a chance to avoid the MFC dependency with out degrading the functionality of the MFC extension dll, my requirement is satisfied.
|
|
|
|
|
I see two choices:
1) Don't use MFC in the DLL.
2) Make the DLL a "regular DLL" Linked to MFC
Option 1 may not be an option.
Option 2 may require significant changes to the App-DLL interface.
Kinds of DLLs[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you. I think I have to stick on the Extension DLL and provide a different one compiled with VC8/9 for newer applications.
|
|
|
|
|
My MFC is rusty, but IIRC MFC extension DLLs must link with the DLL version of MFC. So basically, you can't do what you're asking for.
|
|
|
|
|
Yes.
But my requirement is to use the same dll for both old vc6 projects and for new vc8/9 projects. So there is an option to avoid the MFC dependency. As far as I know, extension dll should be compiled using the same compiler and libraries those are to be used for the client side. So if there is a chance to avoid the MFC dependency with out degrading the functionality of the MFC extension dll, my requirement is satisfied.
|
|
|
|
|
template<class T1, class T2 = T1> class X2
{
};
please explain what it means (class T2 = T1)?
|
|
|
|
|
If you are not specifying the type T2, then it will be T1...
Like X2<int> a;
same as X2<int,int> a;
|
|
|
|
|
|
Consider the following example
template<class class="" t2="T1"> class X
{
public:
T1 a;
T2 b;
};
void main()
{
X<int> m1;
m1.a = 10;
m1.b = 10;
X<int,float> m2;
m2.a = 10;
m2.b = 10.0;
}</class>
Here m1 is having both members as int type. It is created as X<int>, means T1 is int, and T2 which is not specified explicitly, became the default type. That is T1, which is int. So T2 is also int.
In the second case, m2, T1 is int and T2 is specified as float explicitly. Now T2 is float.
Hope now it is clear.
|
|
|
|
|
|
template<class T1, class T2 = T1> class X2 {};
T2 is an optional parameter hence class X2 will be specialised using <t1,> if T2 is not specified,
for instance
X2 <int> x2;
is the same of
X2 <int, int> x2;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
My application is currently working on Vista. When I invoke through Domain1\user1 , it works fine.
When I log as DOMAIN2\user and try to invoke my application it crashes.
I have a observations. In one of the dll which is being used while application is invoked, I changed project settings. I have set Optimization settings as Minimize size. When I rebuid the binary and replace it. Now the application is working fine even as DOMAIN2\user2.
Can I know why this behaviour difference and how did crash get solved.
I am using VC++6.0 on Vista.
Thanks.
|
|
|
|
|
Unless there is a compiler bug (very unlikely) you have a bug in your code that only shows up with optimizations on. Likely this is some kind of memory allocation bug. Impossible to say without seeing your code.
|
|
|
|
|
Hi,
I cannot get VS2005 to work properly on my Vista when I use the dialog app wizard, nothing happens - I have the Sp1 update etc installed for VS. Can someone tell me if there is a workaround for me to get the files the wizard would create, including a blank resource template that I can visually drag and drop controls onto, and if there are still any issues with linking controls to code as I've seen before (I've not had VS installed for ages, and only previously on XP). Would these issues go away on an XP based system.
thanks for any help
cheers
Lee
|
|
|
|
|
Hi all,
This only happens on the release version of my project and it does not happen on the debug version. Also I have the same additional dependencies.
SiteCode.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl hash(char *)" (?hash@@YAIPAD@Z) referenced in function "public: int __thiscall CSiteCode::ReportNICInfoMP(int,class CDeviceLocationInformationList &,class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &,char *)" (?ReportNICInfoMP@CSiteCode@@QAEHHAAVCDeviceLocationInformationList@@AAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@PAD@Z)
1>SiteCode.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl calc_hashnr_new(char const *,unsigned int)" (?calc_hashnr_new@@YAIPBDI@Z) referenced in function "public: int __thiscall CSiteCode::ReportNICInfoMP(int,class CDeviceLocationInformationList &,class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &,char *)" (?ReportNICInfoMP@CSiteCode@@QAEHHAAVCDeviceLocationInformationList@@AAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@PAD@Z)
1>SiteCode.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl calc_hashnr(char const *,unsigned int)" (?calc_hashnr@@YAIPBDI@Z) referenced in function "public: int __thiscall CSiteCode::ReportNICInfoMP(int,class CDeviceLocationInformationList &,class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &,char *)" (?ReportNICInfoMP@CSiteCode@@QAEHHAAVCDeviceLocationInformationList@@AAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@PAD@Z)
1>SiteCode.obj : error LNK2019: unresolved external symbol "unsigned long __cdecl hashpjw(char *,unsigned int)" (?hashpjw@@YAKPADI@Z) referenced in function "public: int __thiscall CSiteCode::ReportNICInfoMP(int,class CDeviceLocationInformationList &,class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &,char *)" (?ReportNICInfoMP@CSiteCode@@QAEHHAAVCDeviceLocationInformationList@@AAV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@PAD@Z)
1>SiteCode.obj : error LNK2019: unresolved external symbol "void __cdecl Add2ByteChecksum(unsigned char *)" (?Add2ByteChecksum@@YAXPAE@Z) referenced in function "public: class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > __thiscall CSiteCode::GetMPSiteCode(class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >)" (?GetMPSiteCode@CSiteCode@@QAE?AV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@V23@@Z)
1>SiteCode.obj : error LNK2019: unresolved external symbol "int __cdecl EncryptDecrypt(unsigned char *,unsigned int,unsigned char,unsigned char)" (?EncryptDecrypt@@YAHPAEIEE@Z) referenced in function "public: class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > __thiscall CSiteCode::GetMPSiteCode(class ATL::CStringT<wchar_t,class ATL::StrTraitATL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >)" (?GetMPSiteCode@CSiteCode@@QAE?AV?$CStringT@_WV?$StrTraitATL@_WV?$ChTraitsCRT@_W@ATL@@@ATL@@@ATL@@V23@@Z)
1>D:\SVN\Licensin System\Work Package\UpdateManager\Release\UpdateService.exe : fatal error LNK1120: 6 unresolved externals
Thanks,
Jonathan
|
|
|
|
|
monsieur_jj wrote: Also I have the same additional dependencies.
Did you forget to add them in the release settings ? Remember that you have to add them both for the debug version and the release version.
|
|
|
|
|
Hello,
I am currently writing a piece of software that needs to know if it is still running on the same PC as it was installed, or if it has been moved or the hardware has changed.
At the moment, I use the PCs network card MAC address, which usually works fine, but fails when the user changes network cards. This can happen if users use docking-stations with seperate NICs, or USB WLAN adapters, so I'd like to not use the MAC address anymore for system identification.
So the question is: are there other suitable ways to uniquely determine a PC? Is there a description of the way Microsoft uses to identify a PC when activating XP or Vista, which seems to work quite well, even if I change my network card my Windows stays activated, only if I do major changes to my hardware like changing the motherboard I will have to reactivate.
So I'd like to do it a similar way. Any hints how I can do this?
Thanks alot,
Erik
|
|
|
|
|
You could try using the computer SID.
|
|
|
|
|
Some (but not all) processors have an ID number. (I seem to remember reading Intel processors had it, but not AMD). You could use the volume-serial number, but this will change if the user replaces the hard disk.
I got the impression that Microsoft looks at multiple sources of identification, and detects a change when a certain threshold of things have changed. This allows you to replace a couple of components without the application breaking.
|
|
|
|
|
This is part of the holy grail for copy protection - it doesn't exist.
MS gets the info from a bunch of hardware on your system and assigns points to each.
e.g.
- How much ram, what type ...
- Graphic card specs
- CPU specs
- Monitor specs
- NIC MAC
The items that are considered to be fairly consistant over the life of a machine receive more points than others e.g. MAC may have a higher point value than the amount of memory.
The license manager checks the current settings against the previous ones (not just the last) and looks at the difference in terms of 'points changed in x amount of time'. If too many points have changed it assumes you are running on a different machine.
[EDIT]
http://www.licenturion.com/xp/fully-licensed-wpa.txt[^]
http://kb.wisc.edu/helpdesk/page.php?id=5294[^]
http://www.microsoft.com/downloads/details.aspx?FamilyID=5cb10f03-27f6-461d-a3db-d440b4ced7f6&DisplayLang=en[^]
[/EDIT]
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
modified on Wednesday, December 10, 2008 12:24 PM
|
|
|
|
|
Dear friends;
How i can set my current date(Y,M,D), to a file name in c++ (DOS)?
Such as "20081210.txt".
Thanks.
|
|
|
|
|