|
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!
|
|
|
|
|
If you know you are going to be puting this code in a GUI, then don't put it into a console application. You'll find yourself starting over unless you know exactly what to change in the project settings after the fact.
It's fairly simple to do what you want. Just create a GUI project (e.g. Dialog based, SDI, MDI). Then, with Windows Explorer, copy all of the files that you want to have in your project into the root directory of the GUI project you just created. Then, from the "File View" tab of the workspace in Visual Studio, right click on the project name, and select "Add file to project...". In the ensuing file dialog, Ctrl+Click all of the files (header and source) that you want to compile into your project. Then click "OK".
You should now be able to build the project assuming that your files build as is in a Win32/MFC environment.
The smart thing to do here, though, would be to put your code into a static library. Then you can keep it separate and re-usable for other projects. You don't have to do this, but it makes it a bit cleaner. If you need more information on how to do this, let me know and I'll provide you with some details.
Hope this helps.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
There are several solution.
- Create Win32 console project.
- Import all H and CPP files.
- Compile project.
Kuphryn
|
|
|
|
|
Hi,
I've been given the task of creating a programmable state machine, ( a class that will take in an input file that will denote the allowable states and actions etc... ) I was thinking of implementing it in XML or something.
Has this been done before? Any hints/tips/code?
Cheers
Asim
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I've done this on more than one occassion and in more than one language.....What language/tools are you using? that makes a difference in how you put it together......
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Hello,
I am a little lost with some code. I have an MDI application without Doc/View Support
The code for File->New is the following (by default).
CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd() ;
// create a new MDI child window
pFrame->CreateNewChild(
RUNTIME_CLASS(CChildFrame), IDR_NICKMITYPE, m_hMDIMenu, m_hMDIAccel);
I want to open a bitmap and have it appear in this new window, yet it appears in the background of the project. How can I get the View to be set to this new window I made and not the background. For some reason, if I call pFrame->GetView() and then retrieve the buffer where my bitmap is, it puts it to the background. I really want to put in this new window, and am lost on how to do that. Can anyone give me any advice or point me to some articales or something that I could use to figure this out?
Thanks a whole bunch,
NickOne
|
|
|
|
|
Hi,
Does anyone have any idea how to create a line connecting two modeless dialogs, like in MSAccess relationship editor?
I could create the dialogs inside a CWnd or CView derived class and even the drag and drop support is enable between the two dialogs (which holds a CListBox control), but I couldn't figure out how to create (or draw) the line connecting them.
Any help or lights on these would be really nice.
Thanks,
Crercio O. Silva / DBTools Development
http://www.dbtools.com.br
|
|
|
|