|
Hi
Please go through this situation
My ManagerApplication will be embedded into HubApplication and one of the Submenu from my Main menu and a Toolbar will also be embedded.If the user selects Tools->LargeIcons from the Main menu of the HubApplication my Toolbar(which is embedded into) is not getting changed to LargeIcons.For this will MFC take care or we should implement?if so can anybody help me with code??thanks in advance
ThomasKennedy
ThomasKennedy
|
|
|
|
|
ThomasBoseKenn wrote:
.For this will MFC take care
Nope, the MFC framework is not responsible for that. You may search in the article part of this site, you may probably find some articles to help you using large buttons on toolbars.
Another way could be to use external components/extensions which would manage this (and much more) for you. A good example of these is the library BCG[^]
I hurt so bad inside
I wish you could see the world through my eyes
It stays the same
I just wanna laugh again
|
|
|
|
|
Is this code ok?
I read a BSTR with a COM-Function, convert the string to uppercase and check if it is a defined string.
USES_CONVERSION;
CComBSTR bstrTag;
VERIFY(pElement->get_tagName(&bstrTag) == S_OK);
if (_tcscmp(_tcsupr(OLE2CT(bstrTag)), _T("WALLPOINT")) != 0)
{
....
}
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
I'm no expert at com and bstrs, so I can't actually help you with your question. But I can help you help yourself.
If you give your questions a more meaningful title, you might get someone who CAN help you reading it.
As for this particular questions, there are some obvious points:
The answer is "No, as you wouldn't be asking if it did work".
Or does this code snippet work, but you are concerned it might not work always?
Please don't take this as a flame; I like this forum, and the people who frequent are very helpful. But they need your input too.
Iain.
|
|
|
|
|
... sometimes my fingers are faster than my brain ...
Thanks Iain!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
I want to convert a BSTR to a TCHAR* string, without using the _bstr_t class. I only work with CComBSTR and the pur BSTR.
I found some code, but I think that the code is not ok.
USES_CONVERSION;
CComBStr bstrName;
foo->get_Name(&bstrName);
LPCTSTR szName = OLE2T(bstrName);
Is the code ok? Can I convert a BSTR with the OLE2T macro? Is a OLECHAR the same as a BSTR?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi,
I am using a CTreeView in a ControlBar tab. I have checked TVS_EDITLABELS style while creating this view. I want to dissmiss the Edit box during label editing when user press return. The concerned view is not the main view of my application and is contained in a CTabCtrl in a ControlBar and not any CChildFrame. So the PreTranslateMessage of the mainframe does not route this messages to this view. I can override the PreTranslateMessage to do the same but if there is any other means to process the return key from this treeview or if anyone has ever faced and solved this problem please reply.
regards
Alex
|
|
|
|
|
Hi friends,
I am a c++ programmer. I want to convert bmp file to png. Can anybody suggest some libraries or links in this regard? How it will work?
Thanks
Satya
|
|
|
|
|
G'day. I have some articles on GDI+ on this site, which show how it is done. Or you can use CXImage or another third party library ( CXImage is also on this site ).
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi Satya,
If you are using VC7 you can use CImage classes for converting images or like as Christian said, you can try any of the code here.
<edit>
you can also try IPicture interfaces if you are ok with COM
</edit>
Cheers
Kannan
|
|
|
|
|
|
I have a PC with allo the dev tools from microsoft.
I wrote some changes to the software(in VC++ ,MFC) that my company has and didn't have any problems on my PC(with WINNT) but when other users in the company tryed using the software on winnt they got Dr Watson.
I tryed the tool DRWTSN32 and got the following info in the log file(from which i understand the fault is in a function called Ordinal6442 that i couldn't find):
"
function: Ordinal6442
5f45c207 8d45d4 lea eax,[ebp-0x2c] ss:0102d7c2=????????
5f45c20a c745d428000000 mov dword ptr [ebp-0x2c],0x28 ss:0102d7c2=????????
5f45c211 50 push eax
5f45c212 6a00 push 0x0
5f45c214 6805040000 push 0x405
5f45c219 895dd8 mov [ebp-0x28],ebx ss:0102d7c2=????????
5f45c21c ff7720 push dword ptr [edi+0x20] ds:00efea06=????????
5f45c21f ff154cb5495f ds:5f49b54c=77e72566
call dword ptr [Ordinal636+0x11a1 (5f49b54c)]
5f45c225 e9c58bfaff jmp Ordinal4809+0x50 (5f404def)
5f45c22a ff6060 jmp dword ptr [eax+0x60] ds:00efea06=????????
FAULT ->5f45c22d 8b01 mov eax,[ecx] ds:6f6d532c=????????
5f45c22f ff5058 call dword ptr [eax+0x58] ds:00efea06=????????
5f45c232 e9f599faff jmp Ordinal2446+0x36 (5f405c2c)
5f45c237 8bce mov ecx,esi
5f45c239 e8198bfaff call Ordinal2463 (5f404d57)
5f45c23e e9f399faff jmp Ordinal2446+0x40 (5f405c36)
5f45c243 8b06 mov eax,[esi] ds:0012fccc=5f4a6d68
5f45c245 ff9088000000 call dword ptr [eax+0x88] ds:00000088=????????
5f45c24b 8b00 mov eax,[eax] ds:00000000=????????
5f45c24d 85c0 test eax,eax
5f45c24f 0f858a5efaff jne Ordinal2385+0x11 (5f4020df)
5f45c255 ff7510 push dword ptr [ebp+0x10] ss:0102d7c2=????????
*----> Stack Back Trace <----*
FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
0012edbc 0042061b 0057ad40 0057ad40 ffffffff 6f000000 !Ordinal6442
0012ff00 5f40b4f3 01bbe198 0013399e 00000000 004eefcd !<nosymbols>
0012ffc0 77f1b9ea 01bbe198 77c440e0 7ffdf000 c0000005 !Ordinal1576
0012fff0 00000000 0046de06 00000000 000000b0 00000100 kernel32!GetProcessPriorityBoost
00000000 00000000 00000000 00000000 00000000 00000000 !<nosymbols>
"
Please tell me how can i find the function that caused the exeption?
Thanks.
avivhal
|
|
|
|
|
Hello !
So, his follows a question I asked yesterday : I need to run a prg which the first it is run time will open excel, and the next times it is called it will bring the excel window on the top and give it the focus.
The first part is ok. The second part does not work. Here is my code :
HWND hWnd;
hWnd = ::FindWindow("XLMain",
NULL
);
if (hWnd!=NULL)
{
::BringWindowToTop(hWnd);
::ShowWindow(hWnd,SW_SHOW);
}
else ...
I've actually tested BringWindowToTop,ShowWindow,SetWindowPos,SetWindowPlacement,MoveWindow but none of these functions are working ... so pls help me before i get with it.
Thanks
~RaGE();
|
|
|
|
|
|
Shog9 wrote:
There's a section on grabbing focus in it
Brilliant, it works !!! Shog, I love you (BTW, Big thanks to Nish also )
~RaGE();
|
|
|
|
|
SetWindowPos has always worked for me, if it does not work I can only assume some code in the other window is bringing it down again.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
That's what I thought until today. Well, I'll keep a link on Nish's article, it might be useful ...
~RaGE();
|
|
|
|
|
Hello.
I'm writing an ActiveX control which was created by MFC ActiveX ControlWizard. I run the ActiveX control in Internet Explorer. I'm trying to obtain a pointer to the container to be able to change the html-page from the ActiveX control.
In the control class which is derived from COleControl I have to following code:
LPOLECLIENTSITE lpSite = GetClientSite();<br />
LPOLECONTAINER lpContainer; <br />
if(lpSite == NULL) AfxMessageBox("Click OK to crash..."); <br />
lpSite->GetContainer(&lpContainer);
The problem is that GetClientSite() returns NULL so the application crashes.
Any help is greatly appriciated. Thanks in advance.
/Charlie.
|
|
|
|
|
Hi,
I've got a code which is adding 2 non-printable characters at the end of the string, which is causing a lot of problem.
Can anyone help me in removing these 2 "funny" characters.
Here is the code
[CODE]
========================================
#include <winsock.h>
#include <windows.h>
#include <iostream.h>
#include <string>
#include <conio.h>
using std::string;
const char *yy;
int u,i;
string final = "<req><loginid>8888<reqtype>08<broadcast><messagetype>M<no>5359846<message>\n";
void main()
{
final.append("<date>02/10/2002 14:30:10\n");
yy=final.c_str();
u=strlen(yy);
for(i=0;i<=u;i++)
{
printf("%c %d\n",yy[i],yy[i]);
}
}
===========================================
[CODE]
Kindly help!!
Many Thanks,
John
|
|
|
|
|
Hello,
simply replace
for(i=0;i<=u;i++)
by
for(i=0;i<u;i++)
So, remove the =.
Then the 2 "funny" characters should not occur.
-Dominik
|
|
|
|
|
Hi Domnik,
I did that and its not removed the second character.
What comes towards the end is 10 and 0.
When I do a for(i=0;i
|
|
|
|
|
You mean the number representation of the linefeed-character?
Well, you could count two less than the string-length (CR/LF), or you could introduce a filtering line, that does skip any LF characters. That way you would even skip internal CR/LF sequences.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
By the way: C++ like would be doing that with iterators. Its just as easy and less error prone. (see your index error dominic has shown)
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
As jh pointed out, you have to change the u to
u=strlen(yy) - 2; when using CR/LF (\r\n)
and u=strlen(yy) - 1; when using LF only (only \n).
|
|
|
|
|
Hi Dominik and Jh,
Yes, your suggestions worked out.
Apparently the problem still persists and I've got no clue why its happening..
What I am doing is just sending in some data to another server using a sendto(). The server program is written in Java.
But when I send it, the server gets it with some non-printing character (ASCII '0') in the begining and it's causing a problem.
Any suggestions, what could be going wrong?
Here's the sendto() code
[CODE]
========================================
e = sendto(sd,final.c_str(),final.length(),0,(struct sockaddr *)&saServer,sizeof(saServer));
========================================
[CODE]
Many Thanks,
John
|
|
|
|