|
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. <
|
|
|
|
|
yes the bitmap is a 32 bit. I think that should solve the problem?
Thanks Buddy.. I'll come back if not..
|
|
|
|
|
Well, that's just one possible cause (and the 32bit thing is not a problem alone, having an empty alpha channel full of 0-s might be), could be something completely different, anyways, good luck...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
So Alpha value controls the transparency of the bitmap. !!!?
Does 0 alpha value mean full transparency?
|
|
|
|
|
Well, that's implementation specific, but i think by the ribbon UI yes, 0 alpha means fully transparent and 255 means fully opaque. Correct me anyone if i am wrong.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
I think you are right. Well then, thanks for your help so far.
|
|
|
|
|
No problem.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Hi All
How can i change the tab control color?I have Dialog and this dialog i have taken Tab Control.And i want to chnge the Tab Control color.Plz help me
|
|
|
|
|
|
I check this url but not working my side.It might be my fault.But Can you give me any running example.
Thanks for reply
|
|
|
|
|
Here is the sample code from that page.
It gave a pure Win32 example, and the below MFC example.
Iain.
The brushes referred to are part of the dialog class and were created when the dialog constructor was called.
Override the OnDrawItem() method for your CDialog derived class using Class Wizard and add the following code, changing variable names as neccessary. It is important to note that a pointer to a CDC object from the handle of the DC passed in via the LPDRAWITEMSTRUCT is required, otherwise only the background of the text will be the desired color.
#define RED RGB(255,0,0)
#define YELLOW RGB(255,255,0)
#define MAGENTA RGB(255,0,255)
#define WHITE RGB(255,255,255)
#define BLUE RGB(0,0,255)
void CMFCTabCtrlDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpdis)
{
CDialog::OnDrawItem(nIDCtl, lpdis);
char szTabText[100];
RECT rect;
UINT bkColor;
CBrush *cbr;
TC_ITEM tci;
CTabCtrl *pTabCtrl = (CTabCtrl *)GetDlgItem(IDC_TAB1);
if (pTabCtrl->m_hWnd == lpdis->hwndItem)
{
switch (lpdis->itemID)
{
case 0:
cbr = &m_brRed;
bkColor = RED;
break;
case 1:
cbr = &m_brYellow;
bkColor = YELLOW;
break;
case 2:
cbr = &m_brMagenta;
bkColor = MAGENTA;
break;
case 3:
cbr = &m_brWhite;
bkColor = WHITE;
break;
case 4:
cbr = &m_brBlue;
bkColor = BLUE;
break;
}
memset(szTabText, '\0', sizeof(szTabText));
tci.mask = TCIF_TEXT;
tci.pszText = szTabText;
tci.cchTextMax = sizeof(szTabText)-1;
pTabCtrl->GetItem(lpdis->itemID, &tci);
CDC *dc = CDC::FromHandle(lpdis->hDC);
dc->FillRect(&lpdis->rcItem, cbr);
dc->SetBkColor(bkColor);
TextOut(lpdis->hDC,
lpdis->rcItem.left,
lpdis->rcItem.top,
tci.pszText,
lstrlen(tci.pszText));
}
}
|
|
|
|