|
I think you need one of these (put that into the PreProcessor settings of your project):
_WIN32_IE=0x0500
WINVER=0x0500
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Taken from winuser.h (mingw 3.4.5)
#if (_WIN32_WINNT >= 0x0500)
#define LWA_COLORKEY 0x01
#define LWA_ALPHA 0x02
#define ULW_COLORKEY 0x01
#define ULW_ALPHA 0x02
#define ULW_OPAQUE 0x04
#endif
|
|
|
|
|
Hi all,
I am converting a double value to CString using format but it is giving negative value,
double val3 = val2/(1024*1024);
CString test_size;
test_size.Format(_T("%d"),val3);
AfxMessageBox(test_size);
Can anybody please tell me what is the error. i am coding in vc2008
|
|
|
|
|
What is val2?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
double
double val0 = c*bps;
double val1 = val0*spt;
double val2 = val1*h;
double val3 = val2/(1024*1024);
|
|
|
|
|
the answer depends on val2 ,so debug and see whats tha value coming for val2. use breakpoints.
||SnAkeBed||
|
|
|
|
|
For answering ur question please tell what is val2 and y u r using "%d"
||SnAkeBed||
|
|
|
|
|
SnaKeBeD wrote: For answering ur question please tell what is val2 and y u r using "%d"
My question itself was, what is "val2". May be you wanted to reply to the OP?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Double and integer are represented as a different binary format.
You should casting double to integer before passing a parameter.
test_size.Format(_T("%d"),(int) val3);
|
|
|
|
|
You are trying tackling with variable of type double variable. If you really wanna to cast the double into integer use casting as :
test_size.Format(_T("%d"),(int) val3);
or use proper format specifier :
test_size.Format(_T("%f"), val3);
- Malli...!
|
|
|
|
|
VCProgrammer wrote: Can anybody please tell me what is the error.
Yes: you haven't properly read the documentation about format specification fields, see for instance [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I need help in solving a problem using farpoint spreadsheet ActiveX control in vc6.
Application was developed by some other team long time back. i need to update the application, when i tried to open the application in vc6
application loading with the following error
ActiveX COntrol cannot be instantiated.
The activeX control "{E2454650-4D87-1102-B8B2-0000C00A958C} is not registered on this computer. Register the control and try again.
I tried registering using regsvr32 the following files came along with the application,which i think are the files of farpoint
fpspr70.dep (DOn know what to do with this file )
FPSPR70.ocx (registered using regsvr32)
fpspru70.dep(DOn know what to do with this file )
fpSpru70.ocx (registered using regsvr32)
spr32d70.dll<Not allowing me to register)
spr32du70.dll(Not allowing me to register)
SS70PP.dll (registered using regsvr32)
I need to know the exact reason fot the error and how to solve it.
Any help or ideas would be greatly appreciated.
Thank you
||SnAkeBed||
|
|
|
|
|
HI
I m havin a listbox and button.Once the user presses the button , a popup dialog should appper .That dialog contains a textbox .The data of the etxbox should be added to listbox in the previous window .
can anyone suggest me a idea?
Br
Gany
|
|
|
|
|
if any problem mail me r email id i ll mail u whole project
/////resource.h code
#define IDD_DIALOG1 101
#define IDD_DIALOG2 102
#define IDC_LIST1 1000
#define IDC_EDIT1 1001
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1002
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
////
////.rc file:::
u need to add to rc file for 2 dialog box
///
///main.cpp
#include <windows.h>
#include "resource.h"
HINSTANCE gInstance;
HWND ghwnd;
INT CALLBACK WndProc2(HWND hwnd2, UINT msg, WPARAM wParam, LPARAM lParam)
{
char Buffer[MAX_PATH];
switch(msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
{
switch((WPARAM)wParam)
{
case IDOK:
GetDlgItemText(hwnd2, IDC_EDIT1, Buffer, sizeof(Buffer));
SendMessage(GetDlgItem(ghwnd, IDC_LIST1 ), LB_ADDSTRING, 0, (LONG)Buffer);
EndDialog(hwnd2, 1);
return TRUE;
}
return TRUE;
}
}
return FALSE;
}
INT CALLBACK WndProc(HWND hwnd1, UINT msg, WPARAM wParam, LPARAM lParam)
{
ghwnd = hwnd1;
switch(msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
{
switch((WPARAM)wParam)
{
case IDOK:
DialogBox(gInstance, MAKEINTRESOURCE(IDD_DIALOG2), hwnd1, WndProc2);
return TRUE;
}
return TRUE;
}
case WM_CLOSE:
EndDialog(hwnd1, 1);
break;
}
return FALSE;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCommandLine, int nShowCmd)
{
gInstance = hInstance;
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, WndProc);
return 0;
}
|
|
|
|
|
It's simple.
Write your button click event handler like this.
CDialog dlg;
if(dlg.DoModal() == IDOK)
{
listBox.AddString(dlg.some_string);
}
Don't forget to copy the contents of the edit control to the class member variable before your dialogue destroyed.
|
|
|
|
|
Hai all,
i am really new to c++. i am vb6 guy.
just started learning the console apps.
now i wonder why codeblocks or vc++ 6 editor did not produce any Owerflow error messge to this code.
#include <iostream>
using namespace std;
int main()
{
unsigned short int a;
a=66000;
cout << "value of a is :" << a;
return 0;
}
</iostream>
codeblocks shows
Value of a is : 464
why 464 ? it should have been tell that "Overfllower" right?
|
|
|
|
|
afridy wrote: a=66000;
I'd be shocked if the compiler didn't warn about possible loss of data on that line.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Easy!
An unsigned short is 16 bits, or 4 hexidecimal digits. Your number is 17 bits, so the most significant bit is simply discarded.
Open up calc, and ensure it is in scientific mode
Enter 66000
Select the Hex radio-button
Now, see that the number is 5 hexidecimal digits (101D0)
Chop off the left-most digit, by entering 01D0
Convert this back to decimal, and lo and behold - 464!
10000000111010000 - 0x101D0 - 66000
0000000111010000 - 0x1D0 - 464
afridy wrote: it should have been tell that "Overfllower" right?
Nope, you have to know that it wont overflow.
|
|
|
|
|
Thanks friends,
so the behiveir of vb6 and c++ is diffrent is it?
vb6 give the owerflow messge when assign 66000 to a integer variable.
but c++ cut of the the most significant bit
Great to now about this. thanks for the nice explanation.
|
|
|
|
|
unsigned short int a;
a = 66000;
The compiler says:
D:\Source\blah.cpp(99) : warning C4305: '=' : truncation from 'const int' to 'unsigned short'
D:\Source\blah.cpp(99) : warning C4309: '=' : truncation of constant value
The error comes from the COMPILER, not the EDITOR. But it still complains...
Iain.
|
|
|
|
|
yES yes your correct.
there is a notification in vc++.
Though did not see any truncation message from codeblocks gcc
|
|
|
|
|
I have a Doc/view application which uses the Ribbon UI. I created 2 bmp image strips with icons placed on it so that I can load it in this app's ribbon UI. But somehow they are not displayed. The bmps were created on a Mac system. Does this affect? What might be the problem. PLEASE HELP.
Thanks
Ronnie
|
|
|
|
|
Check the alpha channel on your bitmaps, maybe the alpha channel is all black, menaing your icons will be 0% visible. Do you otherwise get the buttons on your ribbon (so you can click them, point at them with the mouse) only the icons are not showing? If so, that might be a hint towards the alphachannel missing thing.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
how do we find whether the bitmap has alpha channel?
Thanks for your reply..
|
|
|
|
|
Well, if it is a 32bpp (bits per pixel) BMP then it does. You need some image editor to see how the alpha channel looks like in your image if it has one, like Gimp or Photoshop.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|