|
You can include stdlib.h in your file and then can access __argc and __argv. Alternatively, you can use the MFC way which is CCommandLineInfo. If you look at the implementation of CCommandLineInfo (in appcore.cpp) you will find that it builds up its string using __argc and __targv which is the TCHAR variant of __argv.
|
|
|
|
|
Yanshof wrote: I can use CString and use the CString method Find(...) - but i don't allow to do so.
This makes no sense. Please explain.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
In simple word ... i dont want to use CString.
|
|
|
|
|
Hi
Please help me do a query based on date.
I have m_pSet (a pointer to CRecordset) and a filter m_strFilter
my date is a ColeDateTime in the form of "mm/dd/yyyy"
I need to set: m-pSet->m_strFilter to select records with birthday >= 1/1/1970
Any idea.
Thanks
Dan
|
|
|
|
|
Hi,
in the app i'm writing,i'm using ADO to connect to an Access database.I would like to pass to MySQL.How can i do this?
|
|
|
|
|
Accius wrote: How can i do this?
Use ADO to connect to MySQL instead of Access
|
|
|
|
|
Well,that's what i am doing...My question was is i can still use ADO with MySQL,instead of with Access (as i'm currently doing)
|
|
|
|
|
Moreover,i am not using the ADO.net,but the old ADO
|
|
|
|
|
|
I have a static control with horizontal and vertical scrollbars.
Both scrollbars are enabled and effective (i.e. there is scrolling amount), working fine.
The static control is a subclass of CStatic. I am monitoring the mouse actions in this static control with OnLButtonUp, OnLButtonDown, OnRButtonUp, OnRbuttonDown and OnMouseMove.
Additionally, there is an OnMouseMove in the parent window of the static control (which is the dialog). This monitors if the mouse leaves the rectangle of the static control.
Everything works fine, EXCEPT when the mouse moves from the static control over the vertical scroll bar rectangle, this will not be reported to the parent's OnMouseMove
However, there is no problem with the horizontal scroll bar, and if the vertical scrollbar is disabled, then the mouse move will be reported.
What can be the reason to this behaviour?
|
|
|
|
|
That sounds strange.
If the scrollbars are standard scrollbars (not controls) then they are part of the non-client
area of the static control. I would expect the wParam of a WM_NCMOUSEMOVE message in the static
control then would be HTHSCROLL/HTVSCROLL.
*edit* I guess I should clarify - what sounds strange to me is that the parent would get a
mousemove message when the cursor is on the scrollbar of a child window...
-- modified at 16:15 Thursday 14th June, 2007
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
The scroll bars are separate controls. I'm sorry, I did not mention this, because I thought the fact that the mouse movement over the horizontal scroll bar will be reported makes this clear.
|
|
|
|
|
In that case, it still sounds strange.
I would expect the mousemove messages to go to the scrollbar controls, not the parent
Are the scrollbars children of the dialog or the static control?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
The scrollbars are children of the dialog.
|
|
|
|
|
I can't see where the behavior would be different between the scroll bars.
WM_MOUSEMOVE messages go to the window under the cursor. If the cursor is over a scrollbar
control then the messages should go to that control.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
We have a COM dll built on windows 32 bit OS.
When this dll is attempted to be registered on a 64 bit platform,we get the following error:
INFO: Calling Action w32OcxRegActions10.2.0.1.0 RegisterOCX
OcxPath = ..........dll
WorkingDir = ...........\bin
INFO: Exception thrown from action: RegisterOCX
Exception Name: ErrorRegisteringOCXException
Exception String: OLE initialization or OCX load error while registering OCX
Exception Severity: 0
This dll is registered successfully on a 32 bit platform.
Does not a dll built on 32-bit XP(win2k) get registered on a 64-bit XP using regsvr32?
|
|
|
|
|
I have a DLL which has options to do different tasks based on the options selected during initialization
lets call this A.dll
so say there is an intialization API
AInit( int mode = mode2) // can take mode1 or mode2
Now applications App 1 and App 2 can load this dll but load using different options.
I want to prevent this from happenning simultaneously. in other words my requirements is that someone loads A in mode 1 or mode 2 but not simulataneously in mode 1 and mode 2.
Additionally i could have multiple users, load A.dll in mode 2 ( multiple readers ) but
multiple of Mode 1 or a mix of Mode 1 and Mode 2 should be disallowed.
Is there a way I enforce this in code or ideas to do the same ?
I was thinking on the lines of a Mutex !
Engineering is the effort !
|
|
|
|
|
A Mutex is exactly what you need. Specifically a named Mutex which by being named can therefore be shared between Processes.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hello everyone. I currently have a combination program that is spitting out millions of combinations into a single .txt file and i am having issues with the file crashing when it tries to open. I was wondering if there is a way you can set up the program to put like 500k combinations in one file and then create another file untill it runs out of combinations. I am fairly new to C++ and any help would be appricated. I will post my current code later when i get back home from work. Thank you!
|
|
|
|
|
It seems simple matter... But if you post the relevant code maybe even simpler
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.
|
|
|
|
|
ciphus21 wrote: ...i am having issues with the file crashing when it tries to open.
I'd be more concerned with this at the moment. Splitting the file, even if it worked, sounds too much like "patch."
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ciphus21 wrote: having issues with the file crashing when it tries to open.
I guess that means your app. is crashing when it opens the file? This "Splitting" you talk about won't fix your error. Even if you are running out of memory splitting the file is not a good solution but paging the file into memory would be.
|
|
|
|
|
Do people ever do this:
{
int i, j, k, l, m, n, o;
for (i = 0; i < 1000; i++)
{
}
}
This would be a way to clear i->o off the stack as soon as you don't need them anymore, right? My main reason for using this would be, if I had many variables, and I didn't want to accidentally redefine any variables throughout the entirety of the function. Then again, I could also split it up into multiple functions.
|
|
|
|
|
I only do that in cases where I use a scarce resource like a device context. When you have just ints, those use a relatively insignificant amount of stack space. If you're running into naming errors, fixing the code is preferable to sticking scopes in.
|
|
|
|
|
Michael Dunn wrote: I only do that in cases where I use a scarce resource
Heck, you were typing faster
|
|
|
|