|
It seems that you're subclassing a child of the main window.
If you're using MFC then wndMainForm must equal m_hWnd of the CFrameWnd -derived class.
rechi
|
|
|
|
|
Hi there
does ne1 know how to convert a string to a long
my string contains numeric characters
ie. mystring = "42309492"
or mystring = "-42342"
im using the below but its not working
char * pEnd;
long l;
l = strtol (mystring,&pEnd,0);
can ne1 help
thanks
si
|
|
|
|
|
|
Use the standard library with string streams
#include <sstream><br />
<br />
const char* buffer = "1023451235";<br />
istringstream iss(buffer);<br />
long myLong;<br />
iss >> myLong;
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
you can use atol(), as replied by the above post.
But the reason strtol() is not working in your code is because you havent specified the correct number base.
<br />
l = strtol(mystring, &pEnd, 10)<br />
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
Hi,
I have a problem with my ListCrtl. I use InsertColumn to set the headlines over my columns but I want, that the user can not move the headlines. They should be fix.
I hope somebody can help me how I can solve this problem.
Bye
Julia
|
|
|
|
|
if you use
CListCtrl& ctlList = (CListCtrl&) GetListCtrl();
// set the style of the list control
ModifyStyle ( LVS_TYPEMASK, LVS_REPORT);
ListView_SetExtendedListViewStyle (m_hWnd, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES );
that set it so columns cant be moved
if you use
ListView_SetExtendedListViewStyle (m_hWnd, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP);
then you can move the columns
hope this helps
|
|
|
|
|
Thank you for your tip, but
can I realize that without ListView?
I have only a membervariable type listctrl in my class CBPageDlg : public CPropertyPage.
|
|
|
|
|
The terms "control" and "view" are confusing here.
The ListView_SetExtendedStyle macro works perfectly on "normal" CListCtrls.
Btw, you can also use (I recommend this) CListCtrl::SetExtendedStyle [DWORD SetExtendedStyle(DWORD dwNewStyle);] .
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hello Friends,
In my application I am using SQL Server's database. My database is already uploaded on Internet SQL server.
Hear is my problem:
If I dont have SQL server in my computer, then I get connection error when I am trying to open the connection with this server.
BUT if I have SQL server in my computer then it gets connected with that SQL server on Internet and works fine.
What is problem in this?
If some one knows the solution for this, then please tell me
Thanks
|
|
|
|
|
You probably are initially lacking the client connectivity components on your local computer, but you then get them when you install the SQL server locally.
You might also try just installing MDAC locally and then see if you can connect to the remote SQL server.
C++/MFC/InstallShield since 1993
|
|
|
|
|
Hi All
Can u help i have a sting which contains both Alpha and Numeric Characters
eg. mystring = "344RT",
however i want to remove all numeric characters
so im left with mystring = "RT"
does ne1 know the best function for doing so
thanks in advance
si
|
|
|
|
|
I would do the brute-force way:
mystring.Remove('0');
mystring.Remove('1');
mystring.Remove('2');
mystring.Remove('3');
mystring.Remove('4');
mystring.Remove('5');
mystring.Remove('6');
mystring.Remove('7');
mystring.Remove('8');
mystring.Remove('9'); Perhaps not the best solution, but it works
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Not tested, but this is what I initially thought of :
<br />
#include <ctype.h>
CString strAlphaOnly;<br />
TCHAR cMyString[] = _T("344RT");<br />
<br />
for(int nCount=0; nCount < len(cMyString); nCount++)<br />
if( isalpha( cMyString[nCount] ) )<br />
strAlphaOnly+=cMyString[nCount];<br />
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
i am trying to hide a window after using the animate window function. The code is as follows:
<br />
AnimateWindow(m_hWnd,500,AW_HIDE | AW_SLIDE | AW_VER_POSITIVE);<br />
<br />
this->ShowWindow(SW_HIDE);<br />
am not sure why this isnt working
|
|
|
|
|
The GDI+ Bitmap class has an ApplyEffect method and Graphics has a DrawImage, both of which take a pointer to an Effect based class.
Although the docs relating to Effect's are marked prelim they seem to imply that this functionality exists in the 1.1 GDI+ API accross all OS's.
1. How do i know what version of GDI+ i have when the dll is version 5.1.3097.0 and the headers in the latest PlatformSDK have no Effect definitions anywhere. Went through all the GDI+ headers and no metion of version anywhere. Return from GdiplusStartup says version is 1, but field is an ulong so couldn't represent 1.1 anyways.
2. Is GDI+ 1.1 a part of the .NET release (as i am still using VC++ 6 i wouldn't see it then)
3. All searches on MS (and the web) only turn up the 5.1.3097.0 version dll.
4. Why is there air ?
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Here are some common terms:
1.DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC
2.const CStudent& operator=(const CStudent& s)
{
...
}
3.BOOL operator ==(const CStudent& s) const
{
...
}
Can you tell me how to master these terms?
|
|
|
|
|
DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC are MFC macros. You must use them if you want MFC's DYNAMIC_DOWNCAST macro, the RUNTIME_CLASS macro, and the IsKindOf method to work. Your class must be derived from CObject .
If using a newish version of C++ (VC 6.0 and later, IIRC), and not interfacing with older MFC code that uses these macros, I suggest sticking to the standard C++ dynamic_cast cast operator and the typeid operator. Note that these can't be used on Windows CE prior to version 4.0, as they require runtime library support that isn't available on CE 3.0 and below.
If you want to use DECLARE_DYNCREATE or DECLARE_SERIAL in a derived class, you must use at least DECLARE_DYNAMIC in your base class (otherwise your code will not compile). DECLARE_DYNCREATE enables dynamic creation of objects by MFC: this is required by the document/view framework for creation of document and view objects. DECLARE_SERIAL provides a default implementation of an operator << and operator >> for your class - this is used for object serialisation to a CArchive .
See the documentation topic CObject Class: Deriving a Class from CObject[^] for more information on these macros.
Item 2:
The operator keyword introduces a method that replaces the operator symbol mentioned: i.e. operator= replaces the normal behaviour of the = operator. If operator= is written as a member function, it will be used if the left-hand side of the assignment expression is of the type the operator= is a member of, and the right-hand side is of the type mentioned in the argument. Assuming that this operator= is defined in CStudent , this operator= will be used whenever one CStudent object is assigned to another.
The use of const here indicates that the return value of operator= cannot be modified by the caller, in the same way that the const on the argument indicates that s cannot be modified within the function.
Style note: In accordance with the guidance of 'do as the int s do', operator= should return a CStudent& , not a const CStudent& . See Effective C++[^] for more guidelines on implementing operator= .
Item 3:
operator== has much the same meaning as in #2, but this time we're replacing the == equality operator. We're comparing this against s .
The const at the end of the declaration says something different. It tells the compiler that this function may be called on CStudent objects that are const , i.e. they're read-only. Functions declared const may not modify member variables, unless they're declared mutable .
|
|
|
|
|
|
Without using settimer is there any way we can do simulate
MOUSEDOWN event? Seems like my client doesn't agree with me
go with it. So I have to come up with another idea.
Thank you for your help
|
|
|
|
|
HI,
I HAVE A COM DLL DTSPKG.DLL WITH ME.I WANT TO USE ITS INTERFACE ,I ABSOLUTELY HAVE NO IDEA ,HOW TO DO IT.I NEED HELP...
THANKS AND REGARDS.
|
|
|
|
|
you can view the contents of the dll in the OLE/COM Object Viewer
the dll that you need will probably be in the type librarys part
you can the open up the dll by double clicking on it, copy whats in there to the clipboard
back in visual studio create a new idl file, paste in the contents
of the clipboard, save the file. add this to your project and compile
this will then generate the headers (.h) you need to call your dll
hope this helps
si
|
|
|
|
|
please help
i use CRichEditCtrl with CFormView to open RTF file(have picture)
but found problems
1. it can show only text ,not image
2. i want to show as wordwrap
who can solve these problem ...thank you
|
|
|
|
|
Hi,
Given a list of pathnames, I need to identify which ones reside on the same physical disk (local or remote).
Parsing the pathname for <drive letter="">:\ is insufficient since there may be network mounted disks, symbolic links etc.
Are there any convenient solutions for this?
Many thanks...
|
|
|
|
|
Have a look at the Shell API functions PathIsUNCServerShare(), PathIsUNCServer(), PathIsUNC(). If it isn't a UNC use GetFullPathName() and then compare the drives. If it is the get the UNC and sharename and compare those.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|