|
CString as well as some others are part of 'shared' classes which are shared between MFC and ATL. So yes, you don't need MFC for CString - ATL is enough.
|
|
|
|
|
This is also true (kind of!) for VC++ 6.0, since you can get the WTL 3.1 stuff (from MSDN, do a search on downloads for WTL) and that too has a CString implementation which is non-MFC.
Make sure you have 3.1, not 3.0, as there are some bug fixes (Replace works when the replacement string is a different length to the source section).
Steve S
[This signature space available for rent]
|
|
|
|
|
In my dialog function as following, the key_board input wouldn't get response, why?
BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message) {
case WM_INITDIALOG:
.....
return TRUE;
case WM_CHAR:
switch(wParam)
{
case '1':
record_data_pair(1);
break;
case '2':
record_data_pair(2);
break;
case '3':
record_data_pair(3);
break;
default:
break;
}
return TRUE;
}
default:
return FALSE;
}
Thanks
Sean
|
|
|
|
|
hi
maybe you havn't called TranslateMessage in your message loop. you know what's message loop, yes? any way this is a simple message loop:
while(GetMessage(...)) {
TranslateMessage(...);
DispatchMessage(...);
}
hope it helps
|
|
|
|
|
NO, I guess you misunderstood the question.
The code I posted is a callback function of a DIALOG, which is launched by the main window. i.e, that's not the main window's callback function.
I have TranslateMessage in my WinMain() function.
Any idea about this situation?
Thanks
Sean
|
|
|
|
|
The only other recommendation is to debug the thing and check to see if it's even going into the function at all, when you press a key.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I have had some recent success with the CListView control but I am still having problems. How do I automaticly resize the ListView so I can have a status bar in the program? I tried it manually, but the windows XP status bar is a different size than the Windows 9x/2k status bar. Is there prehaps a GetSystemMetrics() parameter I can use?
-- Steve
|
|
|
|
|
Is it thread-safe?
I'm guessing yes...
I'm hoping yes as well...
J
May the bear never have cause to eat you.
|
|
|
|
|
Nope.
One thread could call SetRegistryKey
while you were happily using the GetProfileInt method.
For most practical purposes though, yes.
|
|
|
|
|
Hey all,
I was wondering.
I created an ActiveX that is used within an IE page.
In that ActiveX, I call URLDownloadToFile.
I am supposed to pass "a pointer to the controlling IUnknown interface of the calling ActiveX component" in the first parameter.
Currently, I pass NULL and it seems to work just fine.
Can you please tell me WHY I am asked to pass a pointer to that IUnknown interface, and what might happen if I pass NULL?
Thanks in advance!
|
|
|
|
|
By doing EnumWindowCallBack and then EnumProcessModules and then
GetModuleBaseName etc I can obtain names of all/or at least most processes running on my computer.
By comparing the name against IEXPLORE.EXE or something like that I can determine if the process is Internet Explorer.
Once I have found an instance of IE running, is there a way to determine which web server/site it is connected to? Also is there a way to get access to the HTML/Source in the browser?
Thanks
|
|
|
|
|
I am having a problem with a multidimensional CArray. It is as follows:
header.h
typedef CArray<cpoint, cpoint=""> TRAIL_PATH;
typedef CArray<trail_path, trail_path=""> MULTI_TRAIL_PATH;
source.cpp
TRAIL_PATH path;
MULTI_TRAIL_PATH mpath
CPoint point;
...
path.Add(point);
...
mpath.Add(path); <- Error (see below)
...
error C2664: 'Add' : cannot convert parameter 1 from 'class CArray<class cpoint,class="" cpoint="">' to 'class CArray<class cpoint,class="" cpoint="">'
No copy constructor available for class 'CArray<class cpoint,class="" cpoint="">'
How do I properly create an array of arrays of structures?
Thanks,
Clint
|
|
|
|
|
the best way around this is to use std::vector. it is superior in all respects to CArray.
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
damn - you beat me to it !!!!
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hey guys - What's the deal with CArray ? I've used it and not had any problems, nor with any of the other MFC collection classes.
I'm not being argumentative, I'm really curious. The MFC collections seem to take a beating around here. I'll admit I'm not familiar with the STL (he said "functor" heh. heh. heh.)
Software Zen: delete this;
|
|
|
|
|
CArray works fine as a container, the differences there are not that great. Now take your CArray of strings - can you sort it ? Ask for the highest value in there ? Remove duplicates ? The power of STL is the functions which can interact with STL containers and the fact that STL containers, unlike the MFC ones, define a common iterator interface so they can easily interact with each other.
Check out my article on STL functors ( or Chris L's for that matter ) to see some of the stuff you're missing out on.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thanks for the info. I'll check those out.
Software Zen: delete this;
|
|
|
|
|
Hi
I am trying to convert CIPAddressCtrl variable to string variable and vice versa.
Can anyone tell me how? or attach some code to do the same.
Thanks
Yogi
|
|
|
|
|
Hi,
Dose any body known how to load .DLL file into your project that have .LIB file also and creating an warpper for that file???
|
|
|
|
|
Your question is difficult to understand, but I'll try to help. Loading a dll is something you do at run time. Using a .lib is something you do at compile time. It is a static library that gets linked in to your final application. If you are asking if it is possible to use both a dll and a .lib at the same time in the same project, then the answer is yes.
Now, I have no idea what you mean by creating a wrapper "for that file". First of all, which file are you talking about? You want to create a wrapper for the .lib? That doesn't make any sense to me. When you write a wrapper for something, you are dealing with source code. When you use a .lib file you are dealing with a binary file.
Can you re-phrase your question?
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
What i mean i create the wrapper for the DLL file I do have the code for that DLL file and the code is writin in C/Win32. Now i want to use this code in the MFC app with the MDI style so where CView it would display that object.
Now i think think this is how i load the dll at run time
HINSTANCE m_hInstDLL;
if ((m_hInstDLL = LoadLibrary("name.dll")) == NULL)
{
return FALSE; // Failed to load the localized resources.
}
else
{
AfxSetResourceHandle(m_hInstDLL);
// Get resources from the DLL.
}
Now after loading the DLL how do i use these function for the DLL? what else to i have to declare that where the wrapper come in. I want to have a class that controls all this functions. where abouts do i start. I hope you known what i'm trying to say.
Then main think is that i want to display the control in CView window or is it called CDocument window...but you known what i'm taking about here.
Thanks for the help Matt
|
|
|
|
|
E3 wrote:
creating an warpper for that file???
By Hands, sir, by your own hands
|
|
|
|
|
Help! hate to get back to this old topic again, but must say that ADO docs is rather lame for C++ programmer. This is something that can be so easily done with VB - but i'm near the end of my VC module.
QUESTION 1:
I need to determine whether a given field is a primary key for foreign key. and put the result in a character string or int.
This is what I did:
char szPK[20];
for(i=0; i<20; i++)
{
szPK[i]='\0';
}
strcpy(szPK, (pRs->Fields->Item[j])->Properties->Item["KEYCOLUMN"]);
I think we're on the right track, execpt the return type.
error C2664: 'strcpy' : cannot convert parameter 2 from 'class _com_ptr_t<class _com_iiid<struct="" adocg::property,&struct="" __s_guid="" _guid_00000503_0000_0010_8000_0
i="" dont="" know="" smart="" pointer,="" so="" i="" have="" no="" idea="" how="" to="" convert:
(prs-="">Fields->Item[j])->Properties->Item["KEYCOLUMN"]
to type: char*
QUESTION 2: how can u tell FK from PK?
QUESTION 3: how can I determine the foreign key associated with a primary key on another table?
I need to get the associated table name and associated field name (FK) given a PK on a given table.
Thank!
Norm
thanks
norm
|
|
|
|
|
Hello,
I have a problem. I have been given some code in C++ by my tutor which I have been told works fine and does exactly as it's supposed to do. I have been given the project of writing a GUI for this, and so have tried compiling and running this in Visual C++ using the console application project. The thing is I can't seem to get VC to put it in a project and compile it.
Any one got any easy ways of doing this?
|
|
|
|
|
I usually just create a new console project. Then I include the files that I know will need to be compiled. The only other thing that I usually need to do is make sure certain include files are properly included.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|