|
SShhh:
I will say you a secret.
LPCTSTR is a 32-bit pointer to a constant character string.
Best regards!!!
Carlos Antollini.
|
|
|
|
|
I think the exect translation is:
L - Long
P - Pointer
C - Const
T - (somthing (could be TCHAR (I don't remember)))
S \
T = - Str
R /
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
correction:
==========
I think the exect translation is:
L - Long
P - Pointer
C - Char
T - (somthing)
S \
T = - Str
R /
LPCTSTR = const char *
LPCSTR = char *
I think
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
Nope, the first one was correct: Long Pointer to Const Tchar String
in WinNT.h: (well, this isn't directly transcript, but you'll get the idea)
#ifdef UNICODE
typedef wchar_t WCHAR;
typedef CONST WCHAR *LPCWSTR;
typedef WCHAR *LPWSTR;
typedef WCHAR TCHAR;
typedef LPCWSTR LPCTSTR;
typdef LPWSTR LPTSTR;
#else
typedef char CHAR;
typedef CONST CHAR *LPCSTR;
typedef CHAR *LPSTR;
typedef CHAR TCHAR;
typedef LPCSTR LPCTSTR;
typedef LPSTR LPTSTR;
#endif
not that it really matters in the long run
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
You can use
CString strTest((LPCTSTR)IDS_TEST);
cout << (LPCTSTR)strTest << "\n";
Cheers!!!
Carlos Antollini.
|
|
|
|
|
My first question is : How to start a SnapIn Project for MMC without thus using ATL therefore without starting a project by ATL COM AppWizard + Insert | New ATL Object -> MMC SnapIn?
MMC Design and Developper kit book of Microsoft Press does not explain that.
My Second question is : How to define or choose the value of _T_CCF_INTERNAL_SNAPIN of CDataObject? Is it arbitrary?
Thanks a lot!
|
|
|
|
|
If you do not want to use the ATL MMC SNAPIN object, get a sample from the MS platform SDK and use that as a skeleton.
I programmed snap-ins using ATL, normal COM and also COM + MFC
ATL was my worst experience. Full of bugs, very inflexible, not documented... - I do not recommend it...
Plain COM was a pain because of message maps etc.. but it worked very well and gave me good control.
MFC was the fastest to deploy but took more playing around to get it working at first. It offered the same control as plain COM.
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
Another question :
I have difficulty in understand the utility and the way in which Microsoft initializes GUID.
I looked at the samples codes of Microsoft and various GUID are initialized in this way:
const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
or
const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
or
const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
So, if I want to add new item, how I initialize GUID of the class of item ?
const GUID NEWCItem::thiscGuid = {??????? };
const GUID NEWCItemcFolder::thiscGuid = {??????? };
|
|
|
|
|
I use UUIDGEN.EXE to get the GUID:
F:\Platform SDK\Bin>uuidgen -s
output:
INTERFACENAME = { /* 46070c72-0b89-48fc-9770-bed9ff193daa */
0x46070c72,
0x0b89,
0x48fc,
{0x97, 0x70, 0xbe, 0xd9, 0xff, 0x19, 0x3d, 0xaa}
};
in your code, replace INTERFACENAME with this: const GUID NEWCItem::thiscGuid
So you will get this:
NEWCItem::thiscGuid = { /* 46070c72-0b89-48fc-9770-bed9ff193daa */
0x46070c72,
0x0b89,
0x48fc,
{0x97, 0x70, 0xbe, 0xd9, 0xff, 0x19, 0x3d, 0xaa}
};
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
hi,
I have a menu with ID "IDR_MENU", now i want to load it dynamically at the "right side" or "left side" of a dialog box in VC++. Is there any CWnd function or any other help....I can load it at the "right side " of dialog by setting menu properties "Right to Left order Allignment", but i want to do this at run time.
Have a nice wishes for helper.
|
|
|
|
|
If this menu is in the menu bar, like File, Edit, View, etc. you are stuck with the window layout that comes with your locale settings, i.e. left to right. You would have to switch locals to get something different.
If this ia a popup menu you can use the TrackPopupMenu function to tell it where to popup. Or if you are creating the menu dynamically you can of course give it an initial location.
|
|
|
|
|
Set the MF_RIGHTJUSTIFY flag for the first top-level item in the menu. That'll move all top-level items on the right edge of the frame. This will look weird, since it's not the standard behavior, but there ya go.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
"MF_RIGHTJUSTIFY " how I can set this Flag of already created menu. which Function is responsible for this settings.
This can be set when menu is designed but i want to make this change at run time.
The Actual problem is
The interface of application is in different languages. and I have to decide at run time the position of menu
|
|
|
|
|
Assuming menu is a CMenu object representing the top-level menu, this ought to do it:
menu.ModifyMenu ( 0, MF_BYPOSITION | MF_RIGHTJUSTIFY );
I haven't tested this, but it sounds right.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
I have this code and I want to force to reload the file from the server (if not it gets it from the cache):
How can I do it?
void getMetar()
{
CString strServerName;
CString strObject;
INTERNET_PORT nPort;
DWORD dwServiceType;
CFtpConnection* pConn = NULL;
CInternetSession* m_pInetSession;
m_pInetSession = new CInternetSession("Unknown",1,INTERNET_OPEN_TYPE_PRECONFIG);
if(!m_pInetSession)
AfxMessageBox("No session");
AfxParseURL("ftp://weather.noaa.gov", dwServiceType, strServerName, strObject, nPort);
if((dwServiceType==INTERNET_SERVICE_FTP)&&!strServerName.IsEmpty())
{
try
{
pConn = m_pInetSession->GetFtpConnection(strServerName, "", "", nPort, FALSE);
}
catch(CInternetException* pEx)
{
char szErr[1024];
pEx->GetErrorMessage(szErr,1024);
AfxMessageBox(szErr);
pEx->Delete();
pConn = NULL;
}
}
else
AfxMessageBox("URL invalid");
pConn->SetCurrentDirectory("/data/observations/metar/stations/");
if(!pConn->GetFile("LEAL.TXT", "tempMet.txt",FALSE))
AfxMessageBox("No found");
}
|
|
|
|
|
I need to have a list of the tables in the current database (which I access using msado library), is there any method to access this information through the connection object?
SQL solutions depending on the database won't work since I don't know which database will be targeting (I mean I can't retrieve a recordset with the information of the user views and the name of the tables like I'd do in Oracle for example)
Thanks
|
|
|
|
|
You might want to take a look at ADOX. Check it out in the MSDN.
(2b || !2b)
|
|
|
|
|
Hi
How do i play multiple mediaplayer controls on windows NT .In Win NT i can play only one song at a time. This is automatic in Win9x .
Thanks
|
|
|
|
|
Hi!
Guess you guys think I'm pretty hung up with this VIEW thingy, but - I have to figure out a few things and one of them is:
What kind of view is for instance used in MSIE?
Bulletproof FTP?
MS Visual C++?
I discovered that CFormView might be a good thing for creating a GUI, but that does in turn give me a kind of "Dialog-like" look - and that is what I'm trying to avoid.
If I draw a button somewhere on the CVIEW, is it then hard to add actions to it?
I have a little demo i've created that draw a button in the middle of the screen... Now I just need to be able to press that button.
Am I approaching it the wrong way?
How can I THEN make a GUI in CVIEW?
(or is it not the right way?)
|
|
|
|
|
Well IE uses a HTML Window, the nearest in MFC is CHTMLView
Visual C++ uses a couple of CDialogBars and a MDI CEditView.
It all depends on the kind of app you are trying to write and what you want to achieve.
I find a CFormView is the best way to do button handling. What are you trying to achieve in a CView. You can add all the needed message handling for a button because a CView is pretty much the equivlent of a basic API Window. You might want to look at some of the API samples for this kind of info.
Michael
|
|
|
|
|
The main thing for me is to find out which ways are the easiest to draw different GUI's.
Ok, the program - and what I want from it:
I am planning on listing som text that I am searching.
The searchstring is beeing retreived from a web-server.
Then I would like to create checkbox'es next to the searchstring found.
The button is a kind of "get that file"-button.
I am trying to create a program that download files it finds on a web-page.
(links)
The reason for this is that my internetconnections sucks and browsing takes ages. (My ISP is having a lot of trouble and I can't wait for them to get their act together and find out what's causing the slow connections)
So when I'm looking for files on web pages (source code for instance) i have a lot of idletime waiting for the browser to show the web page.
So I need a program that can find the files I need, and what better way is it than to create it yourself?
I am currently looking at some source downloaded from this site, called Regiontracker.zip.
It has about 10% of the things i'm looking for - but I might still get some pointer off of it...
|
|
|
|
|
|
I discovered that CFormView might be a good thing for creating a GUI, but that does in turn give me a kind of "Dialog-like" look - and that is what I'm trying to avoid.
In that case, doc/view probably isn't the right thing for you to use. A plain window that you draw yourself would be easier to manage, something like WinAmp. If you want to stick with the standard controls, you'll get the standard look (which really isn't all that horrible, it is standard after all).
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
Hi,
In order to find an item in a ListCtrl i am using Find method of ListCtrl
My code snippet is :
CString sText="something";
LVFINDINFO info;
info.flags = LVFI_PARTIAL | LVFI_STRING ;
info.psz =(LPCSTR) sText;
int nIndex = FindItem(&info);
//it is always returning 0 even not -1 o indicate that the item is not in the list.I can see my item with the text in ListView but
It can not find the item...
Any ideas that can put some light...
with greetings from Germany
Özgür
|
|
|
|
|
If FindItem returns 0, first item in your list contains 'something'. Item numbers are 0-based.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|