Click here to Skip to main content
15,886,788 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Testing my first C driver Pin
Jochen Arndt2-Apr-13 3:05
professionalJochen Arndt2-Apr-13 3:05 
GeneralRe: Testing my first C driver Pin
Erudite_Eric3-Apr-13 3:34
Erudite_Eric3-Apr-13 3:34 
QuestionRe: Testing my first C driver Pin
David Crow2-Apr-13 4:34
David Crow2-Apr-13 4:34 
AnswerRe: Testing my first C driver Pin
Erudite_Eric3-Apr-13 0:45
Erudite_Eric3-Apr-13 0:45 
AnswerRe: Testing my first C driver Pin
Erudite_Eric3-Apr-13 0:58
Erudite_Eric3-Apr-13 0:58 
Questioncode conversion MATLAB to c Pin
Member 99587781-Apr-13 21:12
Member 99587781-Apr-13 21:12 
AnswerRe: code conversion MATLAB to c Pin
Chris Losinger2-Apr-13 7:49
professionalChris Losinger2-Apr-13 7:49 
QuestionAccessing Win32 APIs from WinRT app through Win32 Dll Pin
msr_codeproject1-Apr-13 4:21
msr_codeproject1-Apr-13 4:21 
Hi, I am trying to call Win32 API from Windows Store App. Since Win32 APIs can not be accessed from WinRT, I have written a Win32 Dll and exposed a function.

I am trying to call this function from WinRT App. But I am getting 'Access Denied' Error.

Dll Code:

C++
extern "C" __declspec( dllexport )INT32 ScanWlan()
{
// Declare and initialize variables.

HANDLE hClient = NULL;
DWORD dwError = ERROR_SUCCESS;

DWORD dwMaxClient = 2;  
DWORD dwCurVersion = 0;
DWORD dwResult = 0;

dwResult = WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient);
if (dwResult != ERROR_SUCCESS) 
{
 WlanCloseHandle(hClient, NULL);
 wprintf(L"WlanOpenHandle failed with error: %u\n", dwResult);
 return 1;
}


I am able to call this funtion from WinRT App. But 'WlanOpenHandle' function failed with error 5 (ERROR_ACCESS_DENIED).

I have done this using administrator login also. But still I am getting the same error.

Am I doing the right thing?

Can We access Win32 APIs from WinRT Apps through Dlls (at least).

Any help?

Thank you,

Sai
AnswerRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
Richard MacCutchan1-Apr-13 21:37
mveRichard MacCutchan1-Apr-13 21:37 
GeneralRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
msr_codeproject1-Apr-13 23:17
msr_codeproject1-Apr-13 23:17 
AnswerRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
MicroVirus1-Apr-13 23:43
MicroVirus1-Apr-13 23:43 
GeneralRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
msr_codeproject2-Apr-13 1:03
msr_codeproject2-Apr-13 1:03 
GeneralRe: Accessing Win32 APIs from WinRT app through Win32 Dll Pin
MicroVirus3-Apr-13 10:41
MicroVirus3-Apr-13 10:41 
QuestionCreating an array of global Labels at runtime Pin
Douglas Kirk31-Mar-13 12:08
Douglas Kirk31-Mar-13 12:08 
GeneralRe: Creating an array of global Labels at runtime Pin
Richard MacCutchan31-Mar-13 13:54
mveRichard MacCutchan31-Mar-13 13:54 
GeneralRe: Creating an array of global Labels at runtime Pin
Douglas Kirk31-Mar-13 14:08
Douglas Kirk31-Mar-13 14:08 
GeneralRe: Creating an array of global Labels at runtime Pin
NotPolitcallyCorrect31-Mar-13 14:12
NotPolitcallyCorrect31-Mar-13 14:12 
GeneralRe: Creating an array of global Labels at runtime Pin
Douglas Kirk31-Mar-13 14:28
Douglas Kirk31-Mar-13 14:28 
GeneralRe: Creating an array of global Labels at runtime Pin
NotPolitcallyCorrect31-Mar-13 15:16
NotPolitcallyCorrect31-Mar-13 15:16 
QuestionWhere to post/share example? Pin
ReturnVoid30-Mar-13 1:45
ReturnVoid30-Mar-13 1:45 
AnswerRe: Where to post/share example? Pin
NotPolitcallyCorrect30-Mar-13 2:29
NotPolitcallyCorrect30-Mar-13 2:29 
AnswerRe: Where to post/share example? Pin
Captain Price30-Mar-13 3:27
professionalCaptain Price30-Mar-13 3:27 
QuestionHow to control the other app using Window API Pin
Member 916988729-Mar-13 4:16
Member 916988729-Mar-13 4:16 
AnswerRe: How to control the other app using Window API Pin
dusty_dex29-Mar-13 4:27
dusty_dex29-Mar-13 4:27 
GeneralRe: How to control the other app using Window API Pin
Member 916988729-Mar-13 5:38
Member 916988729-Mar-13 5:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.