Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 17:57

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Find-Window Error

Discussion on Find-Window Error within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2012
Posts: 1
Received Thanks: 0
Find-Window Error

Hi epvpers,

ich beschäftige mich zurzeit ein bisschen mit Speicher auslesen etc.
Euer Forum hat mir dabei übrigens mit den diversen TUTs sehr geholfen ;D
Als ich nun von der Konsolen-Anwendung zur Forms-Anwendung wechseln wollte, bekam ich plötzlich mit gleichem Code folgende Fehlermeldung:

"error C2664: 'FindWindowW': Konvertierung des Parameters 2 von 'const char [15]' in 'LPCWSTR' nicht möglich"

->Sie bezieht sich auf folgende Zeile:

hWnd = FindWindow(0,"Forsaken World"); //->hWnd ist vom Typ HWND^^

Eingebunden hab ich folgendes:

#include "stdafx.h"
#include "Form1.h"
#include <windows.h>
#include <iostream>
using namespace std;

Ich hoffe Ihr könnt mir helfen Danke im Vorraus!
Mr.Plow is offline  
Old 09/12/2012, 18:10   #2
 
elite*gold: 5
Join Date: Sep 2006
Posts: 385
Received Thanks: 218
Code:
auto* a =  L"Ich bin ein wide string!";
auto* b =   "Ich bin ein normaler string!;

//Noch nicht von VS unterstützt, aber z.B. vom gcc:
auto* c = u8"Ich bin ein UTF-8 string!";
auto* d =  u"Ich bin ein UTF-16 string!";
auto* e =  U"Ich bin ein UTF-32 string!";
Alternativ tchar ins Projekt einbinden und das Makro _T verwenden, dann kannst du sogar nach belieben zwischen Multibyte und Unicode wechseln:

Code:
#include <string>
#include <tchar.h>

int main()
{
     TCHAR* a = _T("Yay!");

     typedef std::basic_string<TCHAR> tstring;
     tstring tstr = _T("std::string unabhängig vom Zeichensatz!");
}
Du nutzt einfach den falschen Zeichensatz.
Schau dir diesen Artikel an, da wird das ganz gut erklärt:
Nightblizard is offline  
Old 09/12/2012, 23:49   #3
 
elite*gold: 0
Join Date: Jun 2012
Posts: 187
Received Thanks: 58
Er wollte wissen wo die nächste links ist, nicht wo er nen stadtplan findet.

Code:
#include <iostream>
#include <Windows.h> //für type WCHAR

typedef const WCHAR *LPCWSTR;
void someLPCWSTRfunc( LPCWSTR SomeVar )
{
	
}

void main () {
	someLPCWSTRfunc( L"Some text" );
}
Code:
someLPCWSTRfunc( [B]L[/B]"Some text" );
tnd0 is offline  
Old 09/13/2012, 17:55   #4
 
.SkyneT.'s Avatar
 
elite*gold: 273
Join Date: Sep 2010
Posts: 1,831
Received Thanks: 786
Oder, unter Visual Studio, den Zeichensatz auf Multibyte stellen.
.SkyneT. is offline  
Reply


Similar Threads Similar Threads
How I can find the address for open an alert window?
04/08/2012 - Nostale - 4 Replies
How I can find the address for open an alert window in NosTale? Like this: http://img812.imageshack.us/img812/4595/cattura3l .png You give me only the method for search the correct address, I know how search the pointer.
can't find associated ref error in SR_ShardManager
11/19/2011 - SRO Private Server - 0 Replies
Hi guys when i start sr_shardmanager it give this errors, ofc the same appear in sr_gameserver. I can normally start server and logIn but i think this errors disable somethink or make bugged but idk what. Maybe some1 know how can i repair this. http://img221.imageshack.us/img221/1845/shardsrer rortx.jpg
Insufficient range error in system chat window
09/09/2011 - Shaiya - 1 Replies
working on implementing 70 gear on my testing server and i'm getting "Insufficient range" in the upper system notice box when logged into game. I can't find any errors in any of the server logs and also when I try and link lapis I'm getting a disconnect error 1. has anyone ran into this issue? I have deattached all data bases and have attached original databases that I set server up with. ( doesn't fix issue) any ideas? Edit : here are my logs that have the errors. I also didnt'...
suche ein programm das redvex error nachricht window schließt.
11/19/2010 - Diablo 2 - 3 Replies
hallo zusammen suche ein programm das redvex error msg window schließt so das redvex restarter übernehmen kann :) clickoff funktioniert nicht richtig. das programm von chuja läuft auch nicht so wie es soll....



All times are GMT +1. The time now is 17:57.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.