|
If i add an IP Address Control to my application and run it exits right after it has started, the dialog doesen't even appear. this happens both in debug and release mode.
|
|
|
|
|
|
I have what might be a basic C++ question but I'm hoping someone will indulge me.
In my code I allocate a string and then pass it (as a TCHAR*) to a dialog class through the dialog's constructor, where I assign it to a member TCHAR*. The string is later modified in one of the dialog class's functions and I was hoping the changes would be passed back to the calling code, but they are not, the string remains blank ????
Anyone have any idea on how to go about this ?
Thanks in advance
|
|
|
|
|
Check whether you are working with allocated objects and pointer to them. I think in some of your code you allocate a copy and your lost your way. Why don´t you give back your resulting string (as function like "GetResultString()". It also would give you the opportunity to check the DoModal() Result.
|
|
|
|
|
Show us the code where you "assign it to a member TCHAR*" please.
Signature space for rent. Apply by email to....
|
|
|
|
|
Its quite common to find applications with multiple windows or those that spawn other applications or other instances of itself.
For example IE can be launched via some 1. jscript code, or 2. by the user selecting IE to be launched from a toolbar, start menu etc, or 3. launched by some other application.
If launched using 1 or 3 how do I find out which application or which browser instance is the launcher?
|
|
|
|
|
Is it possible to have a window with only close button as like dialog box.if it is so how to specify while create window.
|
|
|
|
|
Yes!
use the resource editor, when creating a dialog template, just remove the Ok button; or derive a class from CDialog and add it (Close button ) or remove the Ok button manually in the OnInitDialog method.
Max.
|
|
|
|
|
Or, if you are using SDI/MDI framework, add this line in
CMainFrame::PreCreateWindow (CREATESTRUCT &cs)
{
...
cs.style = WS_SYSMENU;
return TRUE;
}
|
|
|
|
|
I have several owner drawn CButtons created on a View. these buttosn are used to scale several plots on the same view. Because the buttons do the same thing (just to different plots, depending on which button is clicked) I want to use the same code to perform the actions. Ie. I do not want 6 different button performing the same actions.
What I want to do is when a button is clicked, detect which plot the user wishes to scale depending on the location of the particular scaling button they clicked. I am having a problem getting the location of the button within the view when clicked. Can anyone offer some assistance here???
Thanks
|
|
|
|
|
You can handle WM_COMMAND message in PreTranslateMessage of your view. wParam contains control ID, lParam contains handle to the control sending the message. Having control handle you can get it's rectangle.
|
|
|
|
|
Maybe ::GetMessagePos() can help you to get the position of the mouse click in the click-handler.
Or you could use differnt instances of the same CButton-derived class, having a constructor taking and storing the associated plot number in a member variable.
The click-handler would then work on this plot number.
This probably is the better way to do it.
|
|
|
|
|
GetMessagePos works like a charm.
It gives position in terms of the entire screen instead of the view, which I would like, but it will do the trick.
A big Thanks!
-Merle
|
|
|
|
|
I had a similar problem when writing a context menu for CTreeCtrl.
You simply do CYourView::ScreenToClient(), and voilá - the client-specific coordinates!
|
|
|
|
|
In the past, many libraries and samples are simulating VC interface. I'm wondering if there's the same stuff for VS.NET interface ?
|
|
|
|
|
I am trying to print the contexts of a CDialog that contains several ActiveX controls. I am looking for a function that I can send a pointer to the CDialog and it will prompt the user for the Printer to use. It would be helpful if the function would take into account Portrait of Lansscape. Any help would be appreciated.
Craig Berry (Developer)
|
|
|
|
|
I need any ideas about http requests catching, not only IE but also Netscape and Opera.
I think "AD Muncher" is very cool, it can catch all HTTP requests. FAQ about AD Muncher
Thanks
|
|
|
|
|
Google for "HTTP Proxy"
Signature space for rent. Apply by email to....
|
|
|
|
|
I need code piece, not the soft.
|
|
|
|
|
Hi,
This will sound very basic and silly!!!
but can someone help me out with finding out how to go about
doing a substr() in C++;
Thanks,
Brgds,
John
|
|
|
|
|
doing a substr() in C++;
You use CString.Mid() (this requires MFC), or
you use std::string.substr() (this is standardized and portable), or
us use strstr(), the plain old C-Library function.
Its up to you.
|
|
|
|
|
if i include winsock2.h in my program i get 64 errors and 11 warning and i don't know why. i've added the Ws2_32.lib to external dependencies.
here are the errors:
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(109): error C2011: 'fd_set' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(209): error C2011: 'hostent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(327): error C2011: 'in_addr' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(625): error C2011: 'linger' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(222): error C2011: 'netent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(241): error C2011: 'protoent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(185) : see declaration of 'protoent'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(229): error C2011: 'servent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(173) : see declaration of 'servent'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(546): error C2011: 'sockaddr' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(385): error C2011: 'sockaddr_in' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(586): error C2011: 'sockproto' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(153): error C2011: 'timeval' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(395): error C2011: 'WSAData' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(329) : see declaration of 'WSAData'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1610): error C2375: 'accept' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1631): error C2375: 'bind' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1650): error C2375: 'closesocket' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1669): error C2375: 'connect' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2091): error C2375: 'gethostbyaddr' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2110): error C2375: 'gethostbyname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2128): error C2375: 'gethostname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1711): error C2375: 'getpeername' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2201): error C2375: 'getprotobyname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2184): error C2375: 'getprotobynumber' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2166): error C2375: 'getservbyname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(865) : see declaration of 'getservbyname'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2147): error C2375: 'getservbyport' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1732): error C2375: 'getsockname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1755): error C2375: 'getsockopt' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1776): error C2375: 'htonl' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1793): error C2375: 'htons' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1810): error C2375: 'inet_addr' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1827): error C2375: 'inet_ntoa' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1690): error C2375: 'ioctlsocket' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1845): error C2375: 'listen' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(789) : see declaration of 'listen'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1863): error C2375: 'ntohl' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1880): error C2375: 'ntohs' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1900): error C2375: 'recv' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1925): error C2375: 'recvfrom' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1951): error C2375: 'select' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1975): error C2375: 'send' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2000): error C2375: 'sendto' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2026): error C2375: 'setsockopt' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2048): error C2375: 'shutdown' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2068): error C2375: 'socket' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2493): error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2466): error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2416): error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2441): error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2363): error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2390): error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2536): error C2375: 'WSAAsyncSelect' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2516): error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2341): error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2239): error C2375: 'WSACleanup' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2273): error C2375: 'WSAGetLastError' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2290): error C2375: 'WSAIsBlocking' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2324): error C2375: 'WSASetBlockingHook' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2256): error C2375: 'WSASetLastError' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2221): error C2375: 'WSAStartup' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2307): error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(65): error C2440: '=' : cannot convert from 'int (__stdcall *)(WORD,LPWSADATA)' to 'int'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(65): error C2440: '=' : cannot convert from 'int (__stdcall *)(WORD,LPWSADATA)' to 'int'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(76): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(int,int,int)' to 'SOCKET'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(76): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(int,int,int)' to 'SOCKET'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(108): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(SOCKET,sockaddr *,int *)' to 'SOCKET'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(108): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(SOCKET,sockaddr *,int *)' to 'SOCKET'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(512): warning C4005: 'AF_IPX' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(540): warning C4005: 'AF_MAX' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(672): warning C4005: 'FD_ACCEPT' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(678): warning C4005: 'FD_CLOSE' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(675): warning C4005: 'FD_CONNECT' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(669): warning C4005: 'FD_OOB' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(663): warning C4005: 'FD_READ' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(569) : see previous definition of 'FD_READ'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(144): warning C4005: 'FD_SET' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(666): warning C4005: 'FD_WRITE' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(570) : see previous definition of 'FD_WRITE'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(455): warning C4005: 'SO_DONTLINGER' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(638): warning C4005: 'SOMAXCONN' : macro redefinition
All help is very appreciated, thanks!
-Rune Svendsen
|
|
|
|
|
Include it before you include windows.h.
Signature space for rent. Apply by email to....
|
|
|
|
|
thank you
|
|
|
|
|
I want to somehow make my "About" box able to automatically write out the version of my program so I don't have to update it each time I make a new version.
How can this be done?
Something else
|
|
|
|