|
Take a look at the FlashWindow and FlashWindowEx functions on MSDN.
Richard
|
|
|
|
|
That's it!
Thanks Richard!
-=Ricky=-
|
|
|
|
|
I've a CLIstCtrl with the Owner data style.
It works great, but when I try to use SetColumnWidth(LVSCW_AUTOSIZE), it resizes the columns in a wrong way, because it considers only visible elements.
So I decided to detemine the max length; I tryed using either CDC::GetOutputTextExtent than CListCtrl::GetStringWidth, but both ignore the space between the column border and the text, and I can't figure howto determine the size of that... I tryed using GetSystemMetrics with SM_CXFIXEDFRAME and SM_CXEDGE, but they seem to be wrong.
Any ideat?
thanks
|
|
|
|
|
To determine the width/height of the scrollbars, use SM_CXVSCROLL/SM_CYVSCROLL as parameters.
|
|
|
|
|
Thanks, but it's not what I nedd...
The control (in report mode) has many column; any column has:
border (if it is visible or not depend on styles selected)
space
text
space
border.
I need to find the size of that spaces...
|
|
|
|
|
You could give the column header a fixed size and use LVSCW_AUTOSIZE_USEHEADER instead of LVSCW_AUTOSIZE. Anyway, you can get the longest string in the column, so just set the column width to this string width + a few pixels ? Or didn't I get the thing ?
~RaGE();
|
|
|
|
|
Using LVSCW_AUTOSIZE_USEHEADER has the same problem than using LVSCW_AUTOSIZE: if a non-visible string is longer than the header it isn't considered.
Yes, what i'm doing il looking for the longest text extent (not the longest string, "w" is larger than "ll") and adding some pixel. But I would like to know how much should be "some pixel"... I think it depends on system font & some other param..
|
|
|
|
|
I am trying to pull the current session variables out in an ATL project, called from the asp. The code looks like this:
CContext cxt;
if ( FAILED( cxt.Init( CContext::get_All ) ) )
{
return E_FAIL;
}
cxt.Response()->Write(_variant_t("This is a test of the veracity of my system <br/>"));
IVariantDictionary* pVD;
cxt.Session()->get_Contents(&pVD);
if (pVD)
{
int nCount = 0;
pVD->get_Count(&nCount);
for (int i = 0; i < nCount; ++i)
{
_variant_t vItem;
_variant_t vIndex(i);
_variant_t vKey;
pVD->get_Key(vIndex, &vKey);
pVD->get_Item(vKey, &vItem);
cxt.Response()->Write(vKey);
cxt.Response()->Write(_variant_t(" = "));
cxt.Response()->Write(vItem);
cxt.Response()->Write(_variant_t("<br/>"));
}
}
IRequestDictionary * pDic;
_variant_t v;
cxt.Session()->get_Value( L"Juju", &v);
cxt.Response()->Write(v);
cxt.Request()->get_ServerVariables(&pDic);
if (pDic)
{
int nCount = 0;
pDic->get_Count(&nCount);
for (int i = 0; i < nCount; ++i)
{
_variant_t vItem;
_variant_t vIndex("Juju");
_variant_t vKey;
pDic->get_Key(vIndex, &vKey);
pDic->get_Item(vIndex, &vItem);
cxt.Response()->Write(vKey);
cxt.Response()->Write(_variant_t(" = "));
cxt.Response()->Write(vItem);
cxt.Response()->Write(_variant_t("<br/>"));
}
}
and while it can pull out a session ID if I ask it to, and the response stuff works fine, I simply cannot get my hands on the variables I have shoved into the session. Does anyone have any ideas ?
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
|
|
|
|
|
So which lines are not working as you'd expect? Are you getting the value for "Juju" back in this line: cxt.Session()->get_Value( L"Juju", &v); ?
I don't think you're gonna get Juju's value out of the bottom for loop. There you're looping through the SERVER variables -- the ones from the HTTP header, which look like this: AUTH_TYPE, CONTENT_LENGTH, REMOTE_ADDR, SERVER_PORT.
Also, I'd recommend creating variables like request and response at the top of the code. Something like this:
IRequest request = cxt.Request();<br />
IResponse response = cxt.Response();
Then you can just do response.Write(...) , which seems more efficient and easier to read.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Alvaro Mendez wrote:
So which lines are not working as you'd expect?
The first collection is empty, that's the one I expect to contain the session variables.
Alvaro Mendez wrote:
Are you getting the value for "Juju" back in this line: cxt.Session()->get_Value( L"Juju", &v);?
No, I am getting VT_EMPTY back. My test string is rendered in my page, but I cannot get ahold of the session variable, which I create in the asp like this
Session("Juju") = "The Dog Faced Boy"
Alvaro Mendez wrote:
I don't think you're gonna get Juju's value out of the bottom for loop
I didn't expect to - I want the session ID as well. The one that is called ASPSESSIONID with garbage after it. Instead I am getting a load of = signs, there are a lot of values there, but I cannot figure how to pull them out. I put 'Juju' in there as an act of desperation, but I was populating that variant with the index of my for loop and expected to be able to iterate through the keys that way, it does not work.
Thanks for helping me with this.
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
|
|
|
|
|
I have a couple of different COM interfaces, including IRequestDictionary, the problem with all is the same. They have a get__NewEnum method which supposedly gives me a 'for each' type iteration over the container, but which I cannot get to work and the MSDN docs are woeful. Does anyone have any suggestions ?
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
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
|
|
|
|
|
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
|
|
|
|