|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hello
I have a win32 Application and a problem with it: it's my code : Code:
hOpen = InternetOpen("Test Aplication",
INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0);
error C2664: 'InternetOpenW' : cannot convert parameter 1 from 'const char [16]' to 'LPCWSTR' can someone help me to solve this problem ? thanks . Last edited by WingedPanther; 06-05-2008 at 04:52 PM. Reason: add code tags |
| Sponsored Links |
|
|
|
|||||
|
It looks like "Test Application" is an incorrect data type for the first parameter. In particular, according to MicroSoft, the first parameter is supposed to be a pointer to a string, not a string.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||
|
Entering a string literal in that way automatically passes in a pointer. Remember that a C string is just a character array and an array is just a pointer.
|
|
|||
|
Thanks
i find best way to solve this problem and i say it : we must write this code : Code:
hOpen = InternetOpen((LPCWSTR)"Test Application",
INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0);
|
![]() |
| Tags |
| lpcwstr, string |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem read pwd protected Access2K dbase - CR9 & VB6 | mrbar | Visual Basic Programming | 2 | 03-10-2008 05:50 AM |
| Problem with arrays and strings | Nille | C# Programming | 4 | 02-04-2008 02:17 PM |
| How to tackle a programming problem? | TcM | General Programming | 10 | 01-07-2008 12:29 PM |
| [C] Comparison problem | Alhazred | C and C++ | 1 | 08-29-2007 05:58 AM |
| Strings | clookid | PHP Tutorials | 2 | 01-13-2007 04:23 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 100%