|
((void)0) will compile to nothing. You usually see something like this
#ifdef _DEBUG
#define assert(x) some_assert_function(x)
#else
#define assert(x) ((void)0) // make assert become nothing
#endif
so that assert's are only enabled in debug builds.
Todd Smith
|
|
|
|
|
Thanks, Todd pal!
Your reply has clarified all my doubts.
Have a nice weekend,
George
|
|
|
|
|
Dear All,
I hope anyone can help me out with this seeming simple problem.
I've implemented a dialog bar with buttons on them which I would like to disable them from time to time. I've used
m_wndDlgBar.GetDlgItem(IDC_BUTTON1)->EnableWindow(FALSE);
and it wouldn't work.
I even disabled it with the resource editor.
Thanks very much for your precious time.
Regards
CT
|
|
|
|
|
Hi there !
It's Hadi with other question about ADO classes
Well, as all of you know ... when you use FindFirst or FindNext, ado engine move the recordset to new record if the record finded ...
My problem is about m_Rs.Find( string, CADORecordset::searchBackward );
This function works well when it find a record but it DOESN'T MOVE the recordset to finded record
What's wrong ?
How can i move the recordset to finded record when i'm using Find( string, CADORecordset::searchBackward ); ???
Regards
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
lets say i have some audio information that i want to output, can anyone point me in the right direction?
Thanks.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
sndPlaySound() if it's a wavefile... (Or a wavefile from a resourcefile)
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
I am a proficient C++ programmer and am familiar with Win 32 Api programming, but am just learning MFC.
I want to write an MFC application that will detect which America's Army Server I am connected to, create an updated webpage and then upload that page via ftp to my websever.
What do I need to learn in order to
a) detect the ip and port numbers to which I am connected.
b) log on to an ftp sever and upload a file.
I could probably do this with dos commands using netstat and a comand line ftp app, but I would rather not.
|
|
|
|
|
Search on MSDN for the Winsock and sockets. This should give you a starting point for reading about IP comms.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
i want to simulate workspace in vc++,i use CTree on the CDialogBar.i want to if select the item that opened active else run OnNewFile.Please Help me
|
|
|
|
|
Send message to your main view,when user selected the tree item.
Sincerely,Pole.
|
|
|
|
|
i want to simulate workspace in vc++,i use CTree on the CDialogBar.i want to if select the item that opened active else run OnNewFile.Please Help me
|
|
|
|
|
i want to simulate workspace in vc++,i use CTree on the CDialogBar.i want to if select the item that opened active else run OnNewFile.Please Help me
|
|
|
|
|
I have a small logging utility that I use across several different applications. When I try to use it from withing an NT Service I can't get any logging. Any gotchas you've run across regarding using COM from an NT Service?
Thanks,
ed
|
|
|
|
|
In general, there is nothing that prevents COM components from being used in NT services. There are some issues you should know:
1. NT services run in a special account that don't interact with user, so if your component tries to display a message box, you're out of luck. Moreover, if you happen to use some MFC classes that cause assertion, they will end up (at least in DEBUG mode) displaying message box that will stop the service (of course without displaying anything).
2. Be careful with use of MFC user interface classes (in other words, don't use them). You can use MFC collection, thread and string classes.
The easiest way to discover what's wrong is to debug your service (select its process in task list, right-click and choose "debug").
Hope this helps.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them.
Jack Handey, Deep Thoughts
|
|
|
|
|
I don't use any user interface. I have a separate control panel applet that handles that. Working on the debugging though...
Thanks,
ed
|
|
|
|
|
That may sound silly, but did you call CoInitialize ?
Also, if you want to see pop-ups from your NT service, you choose "Interact with desktop" check box for the "LogON" tab in the service properties. That way, you may see any assertion failed dialog boxes.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I did. I use a little struct (below - found somewhere??) to initialize and uninitialize.
<br />
struct CComInit {<br />
CComInit() { CoInitialize(NULL); }<br />
~CComInit() { CoUninitialize(); }<br />
};<br />
Then during initialization:
<br />
CComInit comInit;<br />
Thanks...
ed
|
|
|
|
|
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
|
|
|
|