|
If you're compiling an ATL com server, be sure to see if you've got ATL_MINCRT defined. (I think that's the right name..)
IIRC, global object constructors are not called if you use this optimization since the libc is not there to do it for you...
Preferred storyline:
- I am your father. Search your feelings and you'll know it's the truth. Together we can rule this galaxy like father and son.
- Ok dad. Let's kick some butt!
|
|
|
|
|
I have used a lot of COM from services, and have never had a single problem with it.
Just remember that if you write your log to a shared directory on another computer, the default account a service is running under (Local System) don't have access to network resources...
What happens?
Do you create the COM object successfully?
If you have written the COM object yourself, you might use some TRACE in the object so you can see what happens...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I had in my OnInitialUpdate this fragment at the end of the function:
if(NULL != m_THBImage1.GetSafeHwnd())
{
m_THBImage1.MoveWindow(10,10,200,180);
m_THBImage2.MoveWindow(10,200,200,180);
m_THBImage3.MoveWindow(10,390,200,180);
m_THBImage4.MoveWindow(10,580,200,180);
}
Well, the code would run and never go into the block, so that my controls were higgledy piggledy on the screen. I moved it to the start of the function, and it works (though one time it crashed and didnt move the imageboxes). I am uneasy about why the crash and why the relocation works.
Most of the code in the OnInitialUpdate function does database access and sets things up.
The same relocation trick worked for the following in the same function:
if(NULL != m_listdisplay.GetSafeHwnd())
{
m_listdisplay.SetExtendedStyle(LVS_EX_CHECKBOXES);
m_listdisplay.InsertColumn(0,"Options",LVCFMT_LEFT,800);
}
If it was at the end of the function, my listctrl would come up blank with no columnheader, and when moved up, its okay.
The one time it crashed (even after moving the code up), the list ctrl was blank and there was no columnheader. I cant reproduce it but am extremely nervous.
Appreciate your insight.
Thanks,
ns
|
|
|
|
|
Seems like you're return ing before it can get to the code. A TRACE statement could verify this.
ns wrote:
higgledy piggledy
I have to add this term to my glossary.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello,
I've read the article here about getting header control messages from a CListCtrl. It describes how CHeaderCtrl is in CListCtrl and how to reassign (from the wizard) the dialog item ID to 0 for CHeaderCtrl in rerouting messages. However, my case is slightly different. My main view is derived directly from CListView:
class CMyMainView : public CListView
... and in this case, the wizard places ON_NOTIFY_REFLECT macros for all messages. I would like this class to handle some header events (such as click on header button to sort) but I cannot seem to find a way to route the message to where I want.
Any help/pointers to resources?
Thanks!
JennyP
|
|
|
|
|
Can you use LVN_COLUMNCLICK?
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
I have embedded a Property sheet inside CFormView and I want to access the data inside my Document class.
I tried the following command in the first page of my property sheet:
m_doc=(CMyDoc*)GetTopLevelFrame()->GetActiveDocument();
ASSERT_VALID(m_doc);
data=m_doc->GetData();
but keep getting debug assertion error.
I think it's due to my application being MDI as a pose to SDI as the above code works for the latter.
Any suggestions on the command for MDI?
Cheers
Kash
|
|
|
|
|
Here's the boiler-plate code I use for this:
CDoc* pDoc = (CDoc*)((CMainFrame *)<br />
AfxGetApp()->m_pMainWnd)->GetActiveFrame()->GetActiveDocument();
JennyP
|
|
|
|
|
Thank You very much
It works a treat.
|
|
|
|
|
Hi,
I have a text editor (CHtmlEditView) with a current font selection combobox on the toolbar so that the user can change the font type.
However when the cursor is placed on a row with different font than the current selection in the combobox, the combobox must be programmatically updated.
All this works fine except that the focus stays with the updated combo. In this case a second click is necessery to get back the cursor to the desired position ( after the first click the focus goes to the combo) and this might be annoying to the user.
I tried calling SetFocus on the mainframe but this does not place the cursor back to its previous position.
Please help!
R.
|
|
|
|
|
Hello, was anyone successful in adding a spin control to a ListCtrl? I only see people adding drop-down boxes or the standard edit controls, but I need a spin control (or a scroll bar, whatever). I'd appreciate any help on this.
Thank you in advance,
Dennis
MCP, MCSD
|
|
|
|
|
Hi
I'm trying to draw a line and two small circle at both end of that line. When I zoom in, I want only the lenght of the line to be extended and the circle size to be the same. But what happen was the circle size also increase. Anyone know how to fix that circle size even when zooming?
Thanks.
Newbies
|
|
|
|
|
make the circle size inversely proportional to your zoom level
-c
For men use, if they have an evil turn, to write it in marble:
and whoso doth us a good turn we write it in dust.
-- Sir Thomas More
|
|
|
|
|
Thanks! very good solution.
Newbies
|
|
|
|
|
I want to add icons to a CImageList from a precompiled DLL, such as shell32.dll or a dll I compiled myself. I will know the index of the icon. Anyone know how I can do this? I don't want to have to compile the icons into the app so I can easliy update the icons.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
Try with ExtractIconEx or LoadLibraryEx with LOAD_LIBRARY_AS_DATAFILE flag.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
Thanks, ExtractIconEx worked perfectly
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
I'd use ExtractIconEx
Regards,
Brian Dela
|
|
|
|
|
Thanks for the advice.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
Matt Newman wrote:
Thanks for the advice.
No hassel
Regards,
Brian Dela
|
|
|
|
|
The easiest way (AFAIK) is to use ExtractIconEx() . However, this will not let you specify the color depth or dimensions of the device image you wish to load (other than the system-defined large and small sizes), so if you're using non-standard sizes (i.e. for toolbar buttons) then my next suggestion would be using LoadLibrary() and LoadImage() .
Shog9
|
|
|
|
|
Thanks fro the advice!
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
Hi,
I am writing a DLL for a game engine, and I want to include the option to disable task-switching while the game is being played. In other words, I want to disable:
alt-tab
ctrl-alt-delete
ctrl-esc
(The main reason for this is that graphics drivers bugs tend to show up after task switching, and also I am using a file packer that can be cracked quite easily if you can task-switch.)
My question is, what is the best way to go about this? I have seen a lot of stuff about using SystemParametersInfo and SPI_SCREENSAVERRUNNING, but this unfortunately only works on Win95/98/Me, and I want my DLL to work on all platforms. I have seen some code about low-level keyboard hooks for NT too, but so far I have unable to get any of this working properly (I have Win Me myself).
If anybody could give me some suggestions/pointers or just tell me the simplest or most effective way of doing this, I would be very grateful.
Many thanks,
KB
|
|
|
|
|
|
dont forget ctrl+shift+esc, and all the predefined windows keys (win+e ...)
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|