|
char *s=new char[255];
strcpy(s,FindFileData.cFileName);
cout<<s;
somethings="" seem="" hard="" to="" do,="" until="" we="" know="" how="" do="" them.
<b="">_AnShUmAn_
|
|
|
|
|
std::string stores char. You need to use std::wstring to store wchar_t. You probably need to read up on unicode. If it's not your intention to use unicode set your project to use multibyte character strings instead.
|
|
|
|
|
strcpy not working... researching info for converting wstring to string....
no luck yet...
|
|
|
|
|
found it...
wstring s= s;
string ssss;
s=FindFileData.cFileName;
ssss.assign(s.begin(), s.end());
cout << ssss;
Thnx for your help
|
|
|
|
|
But then the question you should ask yourself is this. Why are you building a unicode application in the first place?
|
|
|
|
|
your Character set is Unicode Character Set
<br />
LPTSTR lpc;<br />
lpc=(LPTSTR)LocalAlloc(LPTR,256);<br />
wsprintf(lpc,_T("%s"), _T("c:\\code.txt"));<br />
WIN32_FIND_DATA FindFileData;<br />
HANDLE hp; <br />
<br />
hp = FindFirstFile(lpc, &FindFileData);<br />
LocalFree(lpc);<br />
<br />
whitesky
|
|
|
|
|
hai every body i try to build the MFCAppWzd project to change the remote system user password, and get remote system current user name.please give me the procedure and code for me.
|
|
|
|
|
Start coding dear.
If you then have some problems somebody here is going to help you on that.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
this error is not show in ie 6,0 but error messge box show in ie 7.0.
I don't know why this error messagebox !!!
i wait for reply...
//////////////////////////
// problem source is this
ASSERT(pHtml != NULL);
pHtml->Navigate2(_T("http://www.microsoft.com")); // show err msg
//////////////////////////
error message is below.
"Cannot find "http://www.microsoft.com" Make sure the path of internet address is corredct."
|
|
|
|
|
whats type pHtml?
whitesky
|
|
|
|
|
|
I use like this and it work i write for you maybe its some helpful to you
<br />
m_html2=new CMyhtmlview();<br />
m_html2->Create("CMyhtmlview","CMyhtmlview",WS_VISIBLE | WS_CHILD ,<br />
CRect(0,25,390,185),this,1,NULL);<br />
m_html2->Navigate("www.microsoft.com");<br />
and i RegisterWindowClass chtmlview class
whitesky
|
|
|
|
|
If you call Webbroswer Control's Navigate2 function directly in another thread, CWnd-derived object is not thread safe.
Call it indirectly.(use PostMessage)
|
|
|
|
|
My Application:-
In my Application my output window color settings changes according to my windows(My Computer display) settings . i used buttons in my window
on that button i put a bitmap .
My Problem:-
When i changed windows display settings , all color of my application output window changes according display color .BUT " button's bitmap color not changing according to windows display settings" .
plz give solution that my bitmap color of button also change a according to windows settings
|
|
|
|
|
sahaja_p wrote: When i changed windows display settings , all color of my application output window changes according display color .BUT " button's bitmap color not changing according to windows display settings" .
plz give solution that my bitmap color of button also change a according to windows settings
I think the problem is due to windows changes the color settings of the standerd controls not Custom controls
As you used the ownerdraw button and set bitmap ....
you may provide the themes for your buttons so that with the help of current theme you can change the button bitmap dynamically...
hope you get any information from this post.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
How do we set theme to button..?
|
|
|
|
|
This will help you >
http://www.codeproject.com/buttonctrl/choverbitmapbutton.asp?print=true
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I will probably not follow this up, but what is the problem.
If I place a bitmap on a control (or whatever), I want it to display the same on all systems. If the display settings change then the only thing that should change is the background color.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
hare wnen i included "Themelib.h" file in stdafx.h then iam getting a error in ThemeLib.h that <uxtheme.h> no such file or directory
Now any files aslo inlude to avoid that exception ? and give me clear idea for that
|
|
|
|
|
Hi, I have been trying to learn how to use Direct3D, but I keep running into problems. After scratching my head for a while, and using the OutputDebugString() function, I found out that it was my message loop not branching correctly. It seems that PeekMessage is always returning true so I never get to the block of code that renders to the screen. I can't figure out how to fix the problem though; I was wondering if anyone here has any idea. BTW, I use a wrapper class to hold all my D3D code, thats what the g_Screen.render(); statement comes from.
#include "display.h"
const char g_szClassName[] = "Sandboxdx9";
Display g_Screen;
bool isrendered = false;
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE prevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
wc.cbSize = sizeof(wc);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = NULL;
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
if(!RegisterClassEx(&wc))
{
OutputDebugString("Window Registration failed!\n");
return E_FAIL;
}
hwnd = CreateWindowEx(0, g_szClassName, "Sandbox", WS_POPUP | WS_SYSMENU | WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, hInstance, NULL);
if(hwnd == NULL)
{
OutputDebugString("Window Creation failed!\n");
return E_FAIL;
}
if(g_Screen.init(hwnd) == false)
{
OutputDebugString("D3D initialization failed!\n");
return E_FAIL;
}
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
ShowCursor(false);
memset(&msg,0,sizeof(msg));
while(TRUE)
{
if(PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
{
if(msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
isrendered = true;
g_Screen.render();
}
}
if(isrendered)
OutputDebugString("It rendered.\n");
else
OutputDebugString("It didn't render.\n");
UnregisterClass(g_szClassName, wc.hInstance);
return (int)msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
{
}
break;
case WM_DESTROY:
{
PostQuitMessage(0);
}
break;
case WM_CLOSE:
{
PostQuitMessage(0);
}
break;
case WM_PAINT:
{
}
break;
case WM_KEYDOWN:
{
switch(wParam)
{
case VK_ESCAPE:
{
PostQuitMessage(0);
}
break;
}
}
break;
default:
{
return DefWindowProc(hwnd, msg, wParam, lParam);
}
break;
}
return 0;
}
|
|
|
|
|
Alright this is my second attempt to write a reasonable answer. Do not depend on PeekMessage to return false before your render a screen image. If you are going to make decisions at this level, then you should be making them based on messages. If the function PeekMessage is returning false, then you should be exiting the program.
You caught me off guard with the C level code, but I believe what I stated is correct because I programmed at that level for several years.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Thank you. I tried searching the messageboards before asking, sorry if this question was already answered in another post. The reason I used PeekMessage was mainly because that was how I was taught from all the tutorials I read on the net. Should I just create a timer and render when I recieve WM_TIMER messages instead?
|
|
|
|
|
Sorry I have been away for a while; almost any thing using a PeekMessage loop is probably old school. I had to reread the original post and I recommend visiting gaming sights. A WM_TIMER message will work fine (also old school); just make sure you have a flag to tell you when an update is needed. You will normally here the term dirty flag (like a modified flag), which simply means something has changed. So your timer function will check the flag and if nothing has changed then you do nothing, quick and clean. If something has changed then you need to redraw the screen or preferably only the portions that have changed. Given time you will figure it all out, provided no one else is breathing down your neck.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
hi,
How can we use AutoLoad() to load a bitmap for the button
Thank you
|
|
|
|
|
From The Docs:
// Initialize the owner-drawn button with the id IDC_MYBUTTON as a bitmap
// button. This code is used in the OnInitDialog handler of my dialog.
//The button property should be set as BS_OWNERDRAW
myButton.AutoLoad(IDC_MYBUTTON, this);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 5:48 Saturday 3rd June, 2006
|
|
|
|