Click here to Skip to main content
15,903,175 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: hotmail account Pin
Prakash Nadar17-Apr-06 5:12
Prakash Nadar17-Apr-06 5:12 
GeneralRe: hotmail account Pin
Don Miguel17-Apr-06 5:54
Don Miguel17-Apr-06 5:54 
Questioninclude files Pin
uriblum14-Apr-06 1:20
uriblum14-Apr-06 1:20 
QuestionRe: include files Pin
toxcct14-Apr-06 2:26
toxcct14-Apr-06 2:26 
AnswerRe: include files Pin
Michael Dunn14-Apr-06 8:00
sitebuilderMichael Dunn14-Apr-06 8:00 
GeneralRe: include files Pin
2bee 14-Apr-06 9:01
2bee 14-Apr-06 9:01 
GeneralRe: include files Pin
uriblum14-Apr-06 10:43
uriblum14-Apr-06 10:43 
QuestionWinINet.DLL Pin
WebMaster11-Apr-06 18:27
WebMaster11-Apr-06 18:27 
I've been trying to work with the wininet API to get the IE user agent string for use as part of a larger program I am working on. First I tried this in VB.NET but got no working results. Now I'm trying to code it in C++ as per the example on the MSDN article I found. The code I have so far is:

<code>
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <windows.h>
#include <winioctl.h>
#include <wininet.h>


int main (int argc, char * argv [])
{
DWORD dwSize;
DWORD errorCode;
bool res;

// This call determines the required buffer size.
res = InternetQueryOption(NULL,INTERNET_OPTION_USER_AGENT,NULL,&dwSize);

if (res) {
// Allocate the necessary memory.
char* lpszData = new char[dwSize];

// Call InternetQueryOption again with the provided buffer.
InternetQueryOption( NULL, INTERNET_OPTION_USER_AGENT,lpszData,&dwSize );

// Insert code here to use the user agent string data.
printf(lpszData);

// Free the allocated memory.
delete [] lpszData;
} else {
errorCode = GetLastError();
printf((char*)errorCode);
}
printf("\nDONE!");
return 0;
}
</code>

Each time it runs I get error code as a very large number (3131961397). Not sure what is going on but am hopeing somebody has the answer out there. The MSDN artitcle can be found here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/setting_and_retrieving_internet_options.asp
AnswerRe: WinINet.DLL Pin
Michael Dunn11-Apr-06 21:44
sitebuilderMichael Dunn11-Apr-06 21:44 
GeneralRe: WinINet.DLL Pin
WebMaster12-Apr-06 10:03
WebMaster12-Apr-06 10:03 
QuestionWindows Shutdown Pin
DJ Domino11-Apr-06 12:28
DJ Domino11-Apr-06 12:28 
AnswerRe: Windows Shutdown Pin
2bee 12-Apr-06 6:46
2bee 12-Apr-06 6:46 
GeneralRe: Windows Shutdown Pin
Droze15-Jun-06 4:16
Droze15-Jun-06 4:16 
QuestionATL project to C++/CLI: loader lock problem Pin
Judah Gabriel Himango10-Apr-06 18:10
sponsorJudah Gabriel Himango10-Apr-06 18:10 
AnswerRe: ATL project to C++/CLI: loader lock problem Pin
George L. Jackson11-Apr-06 10:49
George L. Jackson11-Apr-06 10:49 
QuestionHow to Debug a Windows Service Pin
sunil440010-Apr-06 4:25
sunil440010-Apr-06 4:25 
QuestionFile transfer: Client-Server Communication Pin
Kranti12519849-Apr-06 19:46
Kranti12519849-Apr-06 19:46 
Questionstd::string within .NET 2003 Pin
richiebaby9-Apr-06 13:40
richiebaby9-Apr-06 13:40 
AnswerRe: std::string within .NET 2003 Pin
PJ Arends9-Apr-06 15:52
professionalPJ Arends9-Apr-06 15:52 
AnswerRe: std::string within .NET 2003 Pin
Michael Dunn9-Apr-06 18:56
sitebuilderMichael Dunn9-Apr-06 18:56 
AnswerRe: std::string within .NET 2003 Pin
George L. Jackson11-Apr-06 10:44
George L. Jackson11-Apr-06 10:44 
AnswerRe: for opinion.. using wut type of c++ can solved tis problem ? urgent...thk Pin
George L. Jackson7-Apr-06 11:33
George L. Jackson7-Apr-06 11:33 
GeneralRe: i done it...thk u all..let me share tis to u all Pin
George L. Jackson8-Apr-06 1:25
George L. Jackson8-Apr-06 1:25 
GeneralRe: i done it...thk u all..let me share tis to u all Pin
cusack8-Apr-06 19:26
cusack8-Apr-06 19:26 
QuestionInvoke to dynamic library with custom object Pin
dawei.code7-Apr-06 4:28
dawei.code7-Apr-06 4:28 

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.