|
|
Thanks for the reply. But since I have to draw the scrollbars myself (i wasnt able to subclass the original scrollbars present in ListView) so i have to handle WM_PAINT for the ListCtrl.
Regards,
Usman.
|
|
|
|
|
Hi,
I'm trying to load a bitmap by following code but it always returns me a NULL handle
LoadBitmap(NULL,"bitmapfile.bmp");
any pointers for how to make the code work?
P.S.
Bitmap is in application folder, also I have tried with complete path.
Ciao
- Nilesh
|
|
|
|
|
LoadBitmap is used for loading resource bitmaps.
Try
http://support.microsoft.com/kb/q158898/
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
that works.. thanks a lot
- Nilesh
|
|
|
|
|
Use LoadImage API if you want to load from the disk.
Hope this helps,
Usman.
|
|
|
|
|
I want a small MFC application that picks up paramters from the command line.
There are command line parser examples but all of them assume you already have the command line to parse.
Any suggestions as the VC++ help refers to ocnsole apps.
Thanks.
Elaine
The tigress is here
|
|
|
|
|
m_lpCmdLine member of CWinApp class contains command line string. You may parse this string in InitInstance()
ARSALAN MALIK
|
|
|
|
|
or you could use __argc and __argv (double _ before arg)
|
|
|
|
|
Thanx, I didn't knew that before!!!
ARSALAN MALIK
|
|
|
|
|
|
|
You can try GetCommandLine() tooo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
We are using Visual Studio .Net and dump a lot of debug info of our application to a console. Normally this is not a problem, however sometimes the console hangs and I cannot set the focus to the debugger anymore. And if I start the task manager, the whole system seems to hang.
We do use multiple thread to log information to the console, so I created the threads with _beginthreadex instead of CreateThread, but that does not seem to make any difference. Any one got a clue why this might be happening?
|
|
|
|
|
Maybe you need to make calls to printf thread safe, by using a CRITICAL_SECTION object....
void theadsafe_printf(char *lpzText) {
EnterCriticalSection(&cs);
printf("%s",lpzText);
LeaveCriticalSection(&cs);
}
Use InitilizeCriticalSection() to create the cs object.
and DeleteCriticalSection() when finished at the end of your app.
|
|
|
|
|
can anyone plz tell me how to convert an ascii to string and ascii to char using vc++
|
|
|
|
|
What you mean by "ascii"?? Do mean ascii value as an integer or ascii value as a string, i.e. Do you want to convert something like "979899" into "abc"?? Please clarify
ARSALAN MALIK
|
|
|
|
|
Hello to everyody,
I want to draw a line thta connect two points...
I have to paint the line of one color...until here it's ok
But the problem is that I have to paint a piece of it of another color from one point to a distance done.
How can i do it? Because maybe i will need a line equation?
Thanks
|
|
|
|
|
You will definitly need line equation. If you require only two colors (not graduated), i suggest you to draw two lines instead of one using different color. You need to find the coordinate of dividing point using line equation etc.
ARSALAN MALIK
|
|
|
|
|
Hi,
I change the font of the Window...and when i do DrawText it doen't work...with TextOut YES but with DrawText NOT...why? How can i do it with DrawText?
This is the code i use to set the font
CFont font;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT)); // zero out structure
lf.lfHeight = 12; // request a 12-pixel-height font
strcpy(lf.lfFaceName, "Arial"); // request a face name "Arial"
VERIFY(font.CreateFontIndirect(&lf)); // create the font
// Do something with the font just created...
CClientDC dc(this);
CFont* def_font = dc.SelectObject(&font);
dc.TextOut(5, 5, "Hello", 5);
dc.SelectObject(def_font);
// Done with the font. Delete the font object.
font.DeleteObject();
Thanks
|
|
|
|
|
Hi,
I want to create a DLL which puts and icon in the taskbar on click of tht icon an exe is run.
I wrote the following code.
The Compiler is not recognising the VERIFY Macro and AfxGetInstanceHandle method.
This code might be wrong becoz i ma jus trying .
Could someone help me out with this.
<br />
#include <windows.h><br />
#include <shellapi.h><br />
#include "example.h"<br />
#define MYWM_NOTIFYICON (WM_USER+2)<br />
<br />
BOOL WINAPI DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpvReserved)
{<br />
return TRUE;<br />
}<br />
<br />
EXPORT void WINAPI Systray ()<br />
{<br />
DWORD dwMessage=NIM_ADD;<br />
NOTIFYICONDATA tnd;<br />
HWND m_hWnd;<br />
tnd.cbSize = sizeof(NOTIFYICONDATA);<br />
tnd.hWnd = m_hWnd;<br />
tnd.uID = IDR_TRAYICON;<br />
<br />
tnd.uFlags = NIF_MESSAGE|NIF_ICON;<br />
<br />
tnd.uCallbackMessage = MYWM_NOTIFYICON;<br />
<br />
<br />
VERIFY( tnd.hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE (IDR_TRAYICON)) );<br />
<br />
tnd.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;<br />
<br />
<br />
Shell_NotifyIcon(dwMessage, &tnd);<br />
<br />
if(dwMessage == MYWM_NOTIFYICON)<br />
{<br />
if((LPARAM)tnd.uCallbackMessage==WM_LBUTTONDBLCLK)<br />
{<br />
if((WPARAM)tnd.uCallbackMessage==IDR_TRAYICON)<br />
{<br />
ShellExecute(NULL, "open", "http://www.brigsoft.com/", NULL, "", SW_SHOW);<br />
}<br />
<br />
}<br />
}<br />
}<br />
Thanks
U get wht u Give
|
|
|
|
|
Hello,
i need to load (from a file, or from a resource) a jpg to set dialog background.
Anybody can help me, please?
I only found solutions for bitmpap files
Lewix
|
|
|
|
|
|
how to convert a string to char so that i can get the ASCII value in vc++?
|
|
|
|
|
if you want to convert a CString, I used the following once in a similar situation.
define the next:
#if defined (_UNICODE) || defined (UNICODE)
#define _tcstombs wcstombs
#else
#define _tcstombs strncpy
#endif
//in your code you can then convert CStrings to ascii strings--
CString sOriginalStr;
.... //somewhere here sOriginalStr gets a value
char* ascStr = new char[sOriginalStr.GetLength()+1];
_tcstombs(ascStr, sOriginalStr, sOriginalStr.GetLength()+1);
.. //do your thing with the ascistring
delete[] ascStr;
Hope this gets you along...
Greetz,
Davy
|
|
|
|