Windows CE & Pocket PC

Moderators: None (Apply to moderate this forum)
Number of threads: 313
Number of posts: 414

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Casting/Type/LPTSTR problem...HELP Posted by duma4321 on 4 Aug 2006 at 8:31 AM
Hi everyone, can someone help me with the following code

Code:

typedef unsigned short WCHAR;
typedef WCHAR *LPWSTR, *PWSTR;
typedef LPWSTR LPTSTR; //typedef lines are from winnt.h

/*Global Variable*/
int trial = 0;

function(.......)
{
WCHAR s1,s2;
HWND hctl_data, hctl_type;

Edit_SetText(hctl_data, (LPTSTR)(something));
trial++;
s2 = s1;
s1 = *(LPTSTR)(something);

if(trail > 2)
{
trial = 0;
if( s1 == s2)
{
Edit_SetText(hctl_type, TEXT("working");
}

}

}

Code ends:

The Edit_SetText(HWND hWnd, LPTSTR lpString) is similar to the SetWindowText function (actually it was #define). The Edit_SetText function works. Edit_SetText(hctl_type, TEXT("working")) will print out "working".

My questions and problems are in regards to s1 and s2.
Is s1 = *(LPTSTR)(something); correct?
How do I get the unsigned short value out of (LPTSTR)(something)?
My goal is to compare two (LPTSTR)(something). Is there a function in does this, comparing two LPTSTR values? I would also like to know what is LPTSTR? My guess is a pointer to a array or string.

Thx in advance





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.