Lee Jae-cheol
Posts: 12
Joined: Thu Jan 08, 2015 4:25 am

Getting License Information by unsing "GetPropertyValue"

Hello.

I am developing in MFC C++ environment now.

I want to Get License ID and Comp ID by using "GetPropertyValue" function.

please look at my code.

===================================================================================================================
HMODULE hModule = ::LoadLibrary("Trial.dll");
if(hModule == NULL)
return ; // Missing Trial DLL;

GetPropT getPropFct = reinterpret_cast<GetPropT>(::GetProcAddress(hModule, "GetPropertyValue"));

CString strID;
DWORD LengthID = strID.GetAllocLength();

if ( ERROR_MORE_DATA == (getPropFct)(LICENSE_PROP_ID, strID.GetBuffer(), LengthID) )
{
(getPropFct)(LICENSE_PROP_ID, strID.GetBufferSetLength(LengthID), LengthID);
}
===================================================================================================================

I already refer to your tutorial code. but It doesn't worked.

I guess that your API now don't allow CString type not CStringW.

But In my project, CStringW Type is not allowed. and then, I can't get License Information.

Can you help me please ㅠㅠ?
Daniel
Posts: 8279
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Getting License Information by unsing "GetPropertyValue"

Hello,

Can you please make sure the character set of your C++ project is set to "Use UNICODE Character Set"? I've talked with our development team and they confirmed that you shouldn't have any problem in using "CString" when you have an unicode project.

Let us know if this helped, otherwise please give us more details about the issue you are getting.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”