|
Hi
I want to open an existing excel sheet and need to append data.
I m using vc++..giv me suggestions
Thanks
gany
|
|
|
|
|
|
Hello All
i am working in Win32 VC++ using VS 6.0
My task is to display image on Desktop or Window .....I did it and works fine ....but the problem is when i move any other window over the image it erases the image
How to overcome this problem....
Any sugesstion is heartly appreciated..
regards
Aabid
|
|
|
|
|
Where are you processing the image drawing functions?
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Thankx For ur Reply
case WM_PAINT:
{
hdc = BeginPaint(hwnd, &ps);
CxImage* newImage = new CxImage(); newImage->LoadResource(FindResource(NULL,MAKEINTRESOURCE(IDR_PNG1),
"PNG"),CXIMAGE_FORMAT_PNG);
newImage->Draw(hdc, 1, 1);
EndPaint(hwnd, &ps);
return 0;
}
|
|
|
|
|
|
Thanx Dear
But it is in MFC and i am using Win32
|
|
|
|
|
Did you try with WM_ERASEBKGND instead WM_PAINT?
|
|
|
|
|
hey i got these 2 codes and my question is why they produce different result? Aren't they the same??
For example, you key in ABCDEFG
char charval;
printf("Enter a string of character: ");
do{
charval=getchar();
printf("%d\n",charval);
}while(charval!='\n');*/
char charval;
printf("Enter a string of character: ");
do{
printf("%d\n",getchar());
}while(getchar()!='\n');
|
|
|
|
|
They are not the same. Look at the while condition.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
In the program (1) you're printing all the input characters coming from the console
(you're printing eve '\n' .
In program (2) you're printing all odd characters coming from the console (and you're checking for the termination condition only on the even one). This (probably unwanted) beahavior is due to the double call of getchar() (one is in the while condition): each call returns a new character from the console.
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]
|
|
|
|
|
okie tks. i think i understand.
|
|
|
|
|
Hello,
I am working on an. mfc application. In it there is a picture control which contains a bitmap image.
On this images i am placing a radio button control.
The problem is that the background color of radio button is the window default color and the bitmap color is blue.
I want to make the background colour of radio button either transparent or colour it with blue colour.
Please help me.
Thanks
|
|
|
|
|
You must be get color of your image and then use of it on the WM_CTLCOLOR for radiobutton like this:
HBRUSH CasdDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkColor(RGB(53,97,200));
pDC->SetTextColor(RGB(53,97,200));
return hbr;
}
if you are using of a color on your image you can use of COLORREF color=GetPixel(hdc,x,y);
|
|
|
|
|
I got colour of the image and used the aboved code but it is not changing the background colour of the radio button.
Rather it is changing the colour of certain edit boxes and static controls.
Please help me.
Dhiraj
|
|
|
|
|
|
Try handling WM_CTLCOLORBTN the same way.
|
|
|
|
|
My Code:
POSITION p = m_cSysLstCtrl.GetFirstSelectedItemPosition();// as used in MSDN
m_nSelectItemWell = 0;
while (p)
{
// Get the position of the item
m_nSelectItemWell = m_cSysLstCtrl.GetNextSelectedItem(p);//as used in MSDN
//OnItemSelectSys();
}
// Verify CSyData.m_LastName:
m_csWellSelected.Format("%s", m_cSysLstCtrl.GetItemText(m_nSelectItemWell, 0));
What is happening is I get the correct position(according to debug), but when I put the data into a Edit box it is the next position on the listbox that is inserted.(Ex.: select postion 2. Position 3's data is put in the editbox.
Can anyone see what's wrong. I can't. I've checked and re-checked my code with MSDN and it is as above, correct.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Items in a listbox are indexed from 0, so your first item has the index 0, the second has the index 1, the rhitd has the index 2, and so on...so if you you do GetItemText(2, 0) you will get the text of the third item. Could that be your "problem"?
Good luck with the learning
|
|
|
|
|
already knew what you said. I fiquired out what it was. I had put another item in the listbox but that item was not in my vector so there was a difference of 1 item. Thanks anyway.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Hello,
I have a dialog with all kinds of controls, Edit boxes, radio buttons...etc..
I would like to Process data when tab key is pressed only in couple of the edit controls, not any of them. Using pMsg->wParam == VK_TAB in PreTranslate Message will let me do that upon pressing the Tab key anywhere. I thought of capturing the focus on the desired control but didn't work.
Any ideas?
Thanks
|
|
|
|
|
You can use of HWND hwnd=GetFocus(); for get current focus and then you need to check hwnd of your control with it on the VK_TAB.
|
|
|
|
|
If I've understand you well you want to process date on some controls when they lose focus? If so you can setup message handlers (for KILLFOCUS type of messages) on those controls.
Personally I do all my checking when user is done, say when he presses ok button. This is because one can navigate from control while not finishing with his input and then navigate back to that same control to enter more data.
Hope this helps, if no I'll try to be more clear in future posts.
|
|
|
|
|
Hi guys, I'm a new programmer and I'm using CreateFileMapping in my service and trying to open it up with my Process with user A. OpenFileMapping with user A returns a file not found error. I know the file mapping works if I open two processes with the same user. I was able to get two services to share a file mapping correctly. So this must mean that the file mapping is out of scope to user A. Please help.
TCHAR SharedMemoryName[] = _T("Global\\Shared Memory1");
HANDLE handle_SharedMemory = CreateFileMappingA(
INVALID_HANDLE_VALUE,
NULL,
PAGE_READWRITE,
0,
MAX_SH_MEM_SIZE,
(LPCSTR) SharedMemoryName );
TCHAR SharedMemoryName[] = _T("Global\\Shared Memory1");
HANDLE handle_SharedMemory = OpenFileMappingA(
FILE_MAP_ALL_ACCESS,
FALSE,
(LPCSTR) SharedMemoryName );
|
|
|
|
|
Have you enabled "Interact with desktop" for the service?
|
|
|
|