cikara21 37 Posting Whiz

i think there are 1*3 loops :P..
am i wrong again ?..

cikara21 37 Posting Whiz

go to C# forum..thank you..

cikara21 37 Posting Whiz

tadaa this working too..

SystemParametersInfoW(SPI_SETDESKWALLPAPER,0,L"C:\\wallpaper.bmp", SPIF_SENDCHANGE);
cikara21 37 Posting Whiz

what i did..
1. create an empty win32 proj..
2. add a new *.cpp file named "Main.cpp"
3. add a new *.rc file named "Main.rc"

here's my Main.cpp

#include <windows.h>
#include "resource.h"

#define ID_FILE_EXIT 9001
#define ID_STUFF_GO 9002
#define IDD_ABOUT 9003
#define IDD_THIS 9004
#define IDC_STATIC -1
const char g_szClassName[] = "myWindowClass";


BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{ 
    
    switch(Message)
    {
    case WM_INITDIALOG:
      return TRUE;
    
    case WM_COMMAND:
         
    
      switch(LOWORD(wParam))
    
               {
    case IDOK:
               EndDialog(hwnd, IDOK);
               break;
    case IDCANCEL:
               EndDialog(hwnd, IDCANCEL);              
               break;
               }
               break;
    default:
             return FALSE;
             }
             return TRUE;
             }

// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
        
    switch(msg)
    {
               case WM_CREATE:
        {
            HMENU hMenu, hSubMenu;

            hMenu = CreateMenu();

            hSubMenu = CreatePopupMenu();
            AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit");
            AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File");

            hSubMenu = CreatePopupMenu();
            AppendMenu(hSubMenu, MF_STRING, ID_STUFF_GO, "&Go");
            AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&Stuff");
            
            hSubMenu = CreatePopupMenu();
            AppendMenu(hSubMenu, MF_STRING, IDD_ABOUT, "&ABOUT");
            AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&HELP");

            SetMenu(hwnd, hMenu);

//THis code below was commented out due to no icon being used.
            /*hIcon = LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
            if(hIcon)
                SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
            else
                MessageBox(hwnd, "Could not load large icon!", "Error", MB_OK | MB_ICONERROR);

            hIconSm = LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
            if(hIconSm)
                SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
            else
                MessageBox(hwnd, "Could not load small icon!", "Error", MB_OK | MB_ICONERROR);
        */
        }
        
        break;
        
        
        case WM_COMMAND:
            
            
         switch(LOWORD(wParam))
    {
        case IDD_ABOUT:
        {
            int ret = DialogBox(GetModuleHandle(NULL), 
                MAKEINTRESOURCE(IDD_DIALOGABOUT), hwnd, AboutDlgProc);
            if(ret == IDOK)
            {
                MessageBox(hwnd, …
cikara21 37 Posting Whiz

ofcourse..:p

cikara21 37 Posting Whiz

try this..;)

VOID SetWallpaper(TCHAR *szFilename,INT nStyle)
{
	CoInitializeEx(0,COINIT_APARTMENTTHREADED);
	IActiveDesktop* iADesktop;
	HRESULT status = CoCreateInstance(CLSID_ActiveDesktop,NULL,CLSCTX_INPROC_SERVER,IID_IActiveDesktop,(void**)&iADesktop);
	WALLPAPEROPT wOption;
	ZeroMemory(&wOption, sizeof(WALLPAPEROPT));
	wOption.dwSize=sizeof(WALLPAPEROPT);
	switch(nStyle)
	{
	case 0:
		{
			wOption.dwStyle = WPSTYLE_STRETCH;
		}break;
	case 1:
		{
			wOption.dwStyle = WPSTYLE_TILE;
		}break;
	case 2:
		{
			wOption.dwStyle = WPSTYLE_CENTER;
		}break;
	default:
		wOption.dwStyle = WPSTYLE_STRETCH;
	}
	status = iADesktop->SetWallpaper(szFilename,0);
	status = iADesktop->SetWallpaperOptions(&wOption,0);
	status = iADesktop->ApplyChanges(AD_APPLY_ALL);
	iADesktop->Release();
	CoUninitialize();
}
cikara21 37 Posting Whiz

or you should change the dialog ID in the *rc file..

[B]IDD_DIALOGABOUT[/B] DIALOG DISCARDABLE  0, 0, 239, 66
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "My About Box"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON    "&OK",IDOK,174,18,50,14
    PUSHBUTTON          "&Cancel",IDCANCEL,174,35,50,14
    GROUPBOX              "About this program...",IDC_STATIC,7,7,225,52
    CTEXT                     "An example program showing how to use Dialog Boxes\r\n\r\nby Cody",IDC_STATIC,16,18,144,33
END

and

// resource.h
#define IDD_DIALOGABOUT    10000

and..

case IDD_ABOUT:
        {
            int ret = DialogBox(GetModuleHandle(NULL), 
                MAKEINTRESOURCE(IDD_DIALOGABOUT), hwnd, AboutDlgProc);
cikara21 37 Posting Whiz

you've forgotten to include "resource.h"..
use the resource editor to see the ID of the "About Dialog" ..
If you can not find it..then create..
then see the following codes..

// your code
case IDD_ABOUT:
        {
            int ret = DialogBox(GetModuleHandle(NULL), 
                MAKEINTRESOURCE(IDD_ABOUT), hwnd, AboutDlgProc);
// my code..and it worked..
case IDD_ABOUT:
        {
            int ret = DialogBox(GetModuleHandle(NULL), 
                MAKEINTRESOURCE(IDD_DIALOGABOUT), hwnd, AboutDlgProc);

you know what that means..
and why..

cikara21 37 Posting Whiz

the easiest..don't need InitCommonControlsEx(&icex); nor InitCommonControls();

#pragma comment(linker,"/manifestdependency:\"type='win32 name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

i'm sorry..:)

cikara21 37 Posting Whiz

fill it with zeroes then..

size_t buf_size = wcslen(testString);
memset(testString,0,buf_size);
testString = L"You joking?";
cikara21 37 Posting Whiz

this might work..

strcpy(str, "taskkill /f /im "); //adding a space character after an options..     
strcat(str, task3);
cikara21 37 Posting Whiz

alright..

cikara21 37 Posting Whiz

yeah right..
total is currency rite..
try this mates..

float total = 0.0f;
...
total = currency (amount,from,to); 	
system("CLS"); 	
printf("Your currency conversion is: %0.2f\n", total);	
Sleep(1500);
...
cikara21 37 Posting Whiz

wow..it's huge..!@#..i'm sorry..

cikara21 37 Posting Whiz

oh man..i'm so tired..old me..

cikara21 37 Posting Whiz

Can you post the complete codes..please..

cikara21 37 Posting Whiz

no errors!!..what should i do for you?..

I don't just want to get a good grade, I want to understand what I'm doing

alright..thats my girl..

cikara21 37 Posting Whiz

simple..just declare it..you know how to do that..rite mates..

cikara21 37 Posting Whiz

how about this..

ifstream myfile(levelMapFile.c_str()); 
myfile.is_open();
cikara21 37 Posting Whiz

can't find the ID for the HELP button..where is it?..

case [B]ID_ABOUT[/B]:
        {
            int ret = DialogBox(GetModuleHandle(NULL), 
                MAKEINTRESOURCE([B]ID_ABOUT[/B]), hwnd, AboutDlgProc);

HINT : use a different command ID from the dialog ID..:)

cikara21 37 Posting Whiz


Thank you for the answer.
- But I cant figure out where, in this code, my own stuff is to be placed.

Well..
Why dont you try it first..
There is another example for you..

/* 
 * mbstowcs(wchar_t *wcString,char *mbString,size_t nCount);
 */
... 
TCHAR *wcBuf=new TCHAR[100];
CHAR *mbBuf="MB STRING";
#ifdef _UNICODE
mbstowcs(wcBuf,mbBuf,100);
#else
strcpy(wcBuf,mbBuf);
#endif
...
delete[]wcBuf;
...
cikara21 37 Posting Whiz

Upss sorry..

mbstowcs(...)

that will help you..

cikara21 37 Posting Whiz

Try

// wcstombs(char *mbstr,const wchar_t *wcstr, size_t count)
//
...
CHAR *mbBuf= new CHAR[100];
TCHAR *wcBuf=_T("hello");
#ifdef _UNICODE
wcstombs(mbBuf,wcBuf,100);
#else
strcpy(mbBuf,wcBuf);
#endif
...
delete[]mbBuf;
...

wcstombs, strcpy are deprecated..
More secure versions are available..
Take care..

cikara21 37 Posting Whiz

It worked with me..

#include <windows.h>
#include <iostream>

//maybe you should add this
#pragma comment(lib,"kernel32.lib")
#pragma comment(lib,"user32.lib")
// this will puts a lib-search record in the object file

using std::cin;

int main()
{
    HWND hWnd = GetConsoleWindow();
    ShowWindow(hWnd,SW_MAXIMIZE);
    cin.get();
    return 0;
}
cikara21 37 Posting Whiz

Remove the '*'..Should be just 'pvFindPara'..

cikara21 37 Posting Whiz

It's very simple..Just add this..

#include "Form2.h" // or whatever
cikara21 37 Posting Whiz

What's Len?

thats not the important thing..Just have a look at your GlobalAlloc..All you need to do is casting..

cikara21 37 Posting Whiz

Have a look at this point..

//...
int *buf = (int*)GlobalAlloc(GPTR,Len);
//...
cikara21 37 Posting Whiz

Let start with..

//...
md5.getHashFromString(pwd.c_str());
//...
cikara21 37 Posting Whiz

Are u sure it's a keyword..

cikara21 37 Posting Whiz

Actually DDRAW.LIB is part of DirectX SDK :)

wow..You guys so fast..
thats why i'm asking him dude..:)..Go on..

cikara21 37 Posting Whiz

You mean this..

;...
mov ah,01
mov al,02
add al,ah
;...
cikara21 37 Posting Whiz

@tux
Sorry dude..

Where did you get that lib..
Try this..
Project | Add Existing Item..Then add DDRAW.H into your project..

cikara21 37 Posting Whiz
// extra variable
Boolean can_exit;

// form closing
if(!can_exit)
   e->Cancel::set(true);

// button exit click
can_exit = true;

this->Close();

// form load
can_exit = false;

hope that helps..

cikara21 37 Posting Whiz

I'm new..
Is memory leak problem solved..

cikara21 37 Posting Whiz

Well..Since you already know which one is recommended..Good job dude..

cikara21 37 Posting Whiz

Not bad..Good example for beginners..Whats 'she' do anyway..Checking for ports that's been opened? or what..(sorry for my bad English)

cikara21 37 Posting Whiz

It worked with me..

'...
for each m_row as System.Windows.Forms.DataGridViewRow in me.DataGridView1.Rows
    if m_row.Cells("Column1").Value=true then
        me.DataGridView1.Rows.Remove(m_row)
    end if
next
'...
cikara21 37 Posting Whiz

Hello..:p..Thats rite..

cikara21 37 Posting Whiz

First choices..That'll makes your live easier..

cikara21 37 Posting Whiz

No comment..

cikara21 37 Posting Whiz

Show me your OnPaint(..) methods..

cikara21 37 Posting Whiz

I see 5 armors only..Not 6..

cikara21 37 Posting Whiz

Replace..

catch(System::Exception ^er)

with

catch(...) //etc..
cikara21 37 Posting Whiz

Try symbian c++..Visit nokia forum for more info..

cikara21 37 Posting Whiz
... 

int foreign(int x)
{
int i, j;

i = 2 * x;

if (i > 10)
j = x / 2;

return j - 1;
}


int main(/*..*/)
{
int x=10;
cout << foreign(x) << endl;
return 0;
}
cikara21 37 Posting Whiz

Did u see 'include' folder..

cikara21 37 Posting Whiz
//..
compute::compute(int num1, int num2, int &total)
{
   //..
   add(num1,num2,total);
}
compute::add(int num1, int num2, int &total)
{
   endingtotal=num1+num2;
   total=endingtotal;
}

i dono..hope this help..

cikara21 37 Posting Whiz

Who..Me or OP..:p..Nevermind..:p

cikara21 37 Posting Whiz

I see assignment errors..:p