|
strtoul()
a DWORD is a typedefed unsigned long.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
thanx for a precise reply!
|
|
|
|
|
hello,
How to get mousemove msg to a CButton ctrl placed in a dialog.
Mahesh
|
|
|
|
|
Derive your class CMyButton from the CButton one and handle CMyButton::OnMouseMove()
~RaGE();
|
|
|
|
|
hi all,
could you please help me code a file mask matching function?
i mean, i should see if a given name matches a particular mask. the mask should have wildcards *,? , etc.
thanks
Hari Krishnan
|
|
|
|
|
Why reinvent the wheel? Use PathMatchSpec() in shlwapi.dll
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Or, if you don't want to use shlwapi.dll to get PathMatchSpec, a useful function can be found here:
http://www.codeproject.com/string/wildcmp.asp[^]
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
thanks chris, and mike,
you two know it all. don't you ?
Hari Krishnan
|
|
|
|
|
pranavamhari wrote:
you two know it all. don't you ?
I wish! If I knew it all, I would be sitting on a beach in Mexico drinking some beer, instead of freezing up here in Minnesota, USA, drinking some beer. At least Mike is only a 20 minute drive from Mexico.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
I have a dialog box with a list box along the side. There are some check boxes and an edit box to the right of that list. I have it set up so when the list selection is changed the the data on the right (the checks and text field) change also. But I can't find a way to save that information because at the moment all changes are lost when a different list item is selected. Is there a way to fix this?
|
|
|
|
|
Hello,
Some inkjet printers support borderless printing. I also want my software able to print without border. Any idea how to do it?
Thanks,
H.S.Ngai
|
|
|
|
|
hi,
if i create a vc++(/w visual studio.net under winxp pro) application and compile it using the option 'use mfc in static library'.. will this application work under win2k, win98 and winnt without crashing or require the user to download some kind of windows updates to get it working?
if i create a setup files using visual studio.net's 'setup and deployment projects'>'setup wizard', will these setup files works on win98, winnt and win2k?
thx in advance.
|
|
|
|
|
trustno1 wrote:
will this application work under win2k, win98 and winnt without crashing or require the user to download some kind of windows updates to get it working?
That's impossible to answer without knowing what your program does. As long as you only use features that are in all those OSes, the app should work (in theory).
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
That's impossible to answer without knowing what your program does. As long as you only use features that are in all those OSes, the app should work (in theory).
my program uses mfc and odbc. it basically gets input data from the user, stores input data into the db(ms access db, .mdb file is included in the setup) and create text files on the db content(file io).. will these operations work in win2k, win98, and winnt? or do i need to include some .dll with the setup?
|
|
|
|
|
I have recently writen a very simple application in WinXP with VC.NET in MFC with a simple use of an ODBC driver. To make it run on a Windows NT 4.0 workstation, I must install NTSP6 (if not installed, missing DLL error message when launching the application)
|
|
|
|
|
In my project I need to intercept messages sent to a existing application such as MS Word, including intercepting mouse click on toolbar buttons and menu items. For some buttons, I need to be informed that their events are fired, and for some others I need to prevent their event from being fired without out changing their orginal visual effects. I adopted Hook mechanism to implement it but later I found that it's to complex to identify the positions and mouse states. Anyone has better ideas to solve this problem or are their any existing package to meet these requirements?
Thx.
|
|
|
|
|
I have created an application that uses ODBC. I use ODBC as a entry in the ODBC manager in the controll panel (windows), not direct to a database file. Is it possible to write direct to windows registry to create a entry in the ODBC manager in a MFC application . For example a button that creates a ODBC name="myName" and a link to the database file. Hard to explain but is really a simple senario.
Please help me;)
|
|
|
|
|
Take a look at the following ODBC 1.0 function:
SQLConfigDataSource()
It's exactly what you are looking for.
"Well I'm just a hard working corporate slave, my mind should hate what my body does crave.
Well I'm just a humble corporate slave, driving myself into a corporate grave"
Corporate Slave, SNOG
|
|
|
|
|
It worked!!
Thanks a lot, you really helped me a lot there
|
|
|
|
|
I'm trying to better understand how operator=() overloading works. I have the following code:
CBase* pB1 = new CDerived( 1, 2 );
CBase* pB2 = new CDerived( 10, 20 );
*pB1 = *pB2;
The first argument to the CDerived constructor is assigned to a data member in CBase and the second argument is assigned to a data member in CDerived. I have overloaded operator=() for both CBase and CDerived like this:
CBase& operator=( const CBase& src )
{
m_nBaseData = src.m_nBaseData;
return *this;
}
CDerived& operator=( const CDerived& src )
{
m_nDerivedData = src.m_nDerivedData;
return *this;
}
When I wrote *pB1 = *pB2; (like in the code above), I was expecting both operator=() functions to be called and thus both the CBase data member and the CDerived data member to be copied. However, my pointers being pointers to CBase rather that CDerived, only the CBase::operator=() function was called, resulting in a partial copy of the derived object.
I tried making both functions virtual, but the result was the same. The only way I found that resulted in a complete copy is by making my pointers CDerived pointers and adding the following line at the beginning of CDerived::operator=():
*(CBase*)this = (const CBase&)src;
Unfortunately, this is not a good solution since it is quite common that I need to store pointers to a base class without knowing exactly what the object is.
So, my question is did I miss something somewhere? Is there a way to have objects copy completely with pointers to their base class?
Thanks!
|
|
|
|
|
You *could* do a <dynamic_cast> in your operator = to see if you have a derived object and make the copy happen. But that's a little tedious and an implimentation nightmare if your class structure will be extended/changed. I'm sure there is a better solution, but it escapes me at the moment.
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
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Assignment operators are not virtual, they are looked up at compile-time. When you hold a pointer to base, pB, and tell the compiler you want to assign something to this base object, as in
*pB = whatever;
it emits a call to Base::operator=(whatever).
On your second problem; from the derived class' operator= call the baseclass' op=, as in:
CDerived& operator=( const CDerived& src )
{
Base::operator=(src);
m_nDerivedData = src.m_nDerivedData; return *this;
}
Depending on compiler (i.e. MSVC6) you sometimes have to introduce a temporary pointer, like:
Base* p = this;
*p = src;
...
++luck;
|
|
|
|
|
For classes like this, I always create a virtual function named "Copy", the operator= then calls it's open "Copy" function. If the base class has a Copy function, the derived class usually calls it, otherwise it usually calls the base class's operator= function (yes, there are times, albeit rare, I do the copy entirely in the derived class.)
(I almost always have a function equivilents to operators, though these functions may incorporate several operators, like "Compare".)
|
|
|
|
|
and by the way, disabling Alt+Enter, Alt+tab, Ctrl+Escape, when the app is fullscreen. I know the W98 screensaver trick, I tried several NT tricks but none of them apply to Windows XP. I am searching for C/C++ coding.
Thank you.
|
|
|
|
|
If you want to do programatically (I don't know any other way to do it , but I'm novice...) you must install a system wide keyboard hook.
In that hook (that must be placed in a DLL) you can handle all the key presses (except the mytical Ctrl+Alt+Del that must be handled in a GINA.DLL).
If you want to install that hook from the beggining you can install an autostart service that activates it.
Hope this helps.
|
|
|
|