|
I tried to get an IHTMLWindow2 interface using your suggestion, but was unsuccessful. I need to use the function HRESULT IHTMLWindow2::get_history(IOmHistory **p), but I have yet to find a way to reach that interface.
Perhaps I am not looking at the right place or that interface is not reachable. I am a little new to this area of VC++, please excuse me if the answer might be apparent.
|
|
|
|
|
I have used the makefile(s) that VC++ generates in order to create a batch file that could automate system rebuilds. The problem with it is that it is still a manual process to export the makefile, especially following some project change, ie. adding new files. Is there a way to put together a batch file that can be executed such that it will cause VC++ projects to be completely rebuilt.
What I'm lookng for is something like the following
C:\...\msdev.exe -RebuildAll Project1.dsp -Silent -ErrorLog BuildProject1Error.txt
and to then have the project loaded and all configurations rebuilt from scratch. This would also include any special pre-build and post build operations.
Anyone know of some way of doing this?
Thanks.
Chris Meech
Is such a
|
|
|
|
|
VC++ User's Guide/Working with Projects/How Do I.../Building a Project/Building a Project from the Command Line.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz, you keep this up and you will be getting my Gold Star for the week.
I have just traversed into the User's manual to the page you hilighted for me and that is exactly what I'm looking for.
Thanks once again.
Chris Meech
|
|
|
|
|
How can i let the users browse a DIRECTORY ( not a file! )
(let's say when cliking on the BROWSE button)???
it would be a great help
|
|
|
|
|
If you are looking for a DirOpenDialog, use this function:
SHBrowseForFolder( BROWSEINFO *mPtrBInfo );
Look in MSDN for detail info about the BROWSEINFO structure.
You can use this for Printer, Network resource, etc...
BOOL SelectFolder( CString& nFolderName, LPCTSTR nTitulo, UINT nFlags )
{
BOOL bRet;
char pszPath[MAX_PATH];
BROWSEINFO mPtrBInfo;
mPtrBInfo.hwndOwner = NULL; // HWND
mPtrBInfo.pidlRoot = NULL; // LPCITEMIDLIST
mPtrBInfo.pszDisplayName = pszPath; // LPTSTR
mPtrBInfo.lpszTitle = nTitulo; // LPCTSTR
mPtrBInfo.ulFlags = nFlags | BIF_RETURNONLYFSDIRS;
mPtrBInfo.lpfn = NULL; // BFFCALLBACK
mPtrBInfo.lParam = 0L; // LPARAM
mPtrBInfo.iImage = 0; // int
if ( OleInitialize( NULL ) != S_OK )
AfxMessageBox( "Error inicializando OLE" );
ITEMIDLIST *mPtrIList = SHBrowseForFolder( &mPtrBInfo );
bRet = SHGetPathFromIDList( mPtrIList, pszPath );
OleUninitialize();
if ( bRet )
nFolderName = pszPath;
return bRet;
}
|
|
|
|
|
How can I make an Editbox control visible or invisible
throw the code.
I know : object.visible=1
but what is the object???
can some one can give an example
( let's say that the edit controll ID is ID_EDIT2
|
|
|
|
|
CWnd* pCtrl = GetDlgCtrlID(ID_EDIT2);
if ( pCtrl )
if ( pCtrl->IsVisible() )
pCtrl->ShowWindow(SW_HIDE);
else
pCtrl->ShowWindow(SW_NORMAL);
Is this what you are looking for?
Chris
|
|
|
|
|
Shouldn't that be
<br />
CWnd* pCtrl = GetDlgItem(ID_EDIT2);<br />
Michael
|
|
|
|
|
Thanks, Michael.
You are correct. In my haste to post, I forgot to try and compile
Chris
|
|
|
|
|
When using very large coordinates for GDI calls there's seems to be severe performance hits. (Let's say I have a client area (0, 0, 100, 100) and call make these calls: dc -> MoveTo(-30000, -30000); dc -> LineTo(30000, 30000);)
I store my objects as floats, do my own scaling, and since allow a very generous scale these large values will show up even for normal objects after conversion to device coordinates.
Adding a clipping region doesn't seem to help so I want to know if I have to do the clipping myself?
I'm using Windows 2000 and I don't think 16-bit GDI is the cause of the problem.
|
|
|
|
|
Hello,
Our projects currently use ifsteam to read in a custom configuration text file (just comma delimited). We just realized (actually QA did) that these files are not locked when opened and can cause some major problems when both projects are run at the same time. Without re-writing a huge portion of code, is there an easy way to lock a file when it is opened? I couldn't find any ios:: flags that would do this for ifstream. We are using VC++ 6.0 and the standard STL library that it ships with.
Thanks in advance!
|
|
|
|
|
There's a 3rd parameter to open which defaults to filebuf::openprot. Search for that definition in the ifstream header or your docs. It's defined as the share/prot mode.
Todd Smith
|
|
|
|
|
I think I realized that there's more to this on our side as well. The file is already closed when the other program opens it up, so I need to do some file locking to prevent this.
Thanks for the reply. The help files for STL that ships with VC++ is horrendous and needs a face lift. Just displaying a cryptic class doesn't count as help in my book!
Derek
|
|
|
|
|
Hi,
perharps it's me just not searching deep enough, but I can't seem to find basic instructions to make and use a DLL. Where should I start?
Thanks!
|
|
|
|
|
I had exactly the same problem when starting out.
Check out : http://www.codeguru.com/dll/index.shtml
There are different types, the main issues are whether you require to build upon MFC objects, or are dealing with C++, as opposed to simply calling a C function.
The other question is whether you want to link at runtime.
The simplest way to get started is probably to create a function declared
as follow, in a WIN32 DLL App Wizzard Project:
extern "C" __declspec(dllexport) long test(char *szTestParam)
Then to use the DLL in another project, you must adjust the project settings to link to the lib file for the project (in the library text box).
And declare
extern "C" __declspec(import) long test(char *szTestParam;
Your then free to use the function.
Simple as that, (Well! Once you get stuck into it, it's straight forward!)
Have Fun Hope I've Helped
Rich
|
|
|
|
|
//function
BOOL& EvaluatingEditChecks()
{
CRreFrameWnd* pRreFrameWnd = ::RreGetMainWnd();
ASSERT (pRreFrameWnd);
return pRreFrameWnd->m_bEvaluatingEditChecks;
}
//calling code
::EvaluatingEditChecks() = TRUE;
int nEvalState = pEditCheck->m_pExprRoot->Evaluate(pRreDlgEntry);
::EvaluatingEditChecks() = FALSE;
Can you explain what assigning true and then false to a fuction means?
thanks
|
|
|
|
|
It is equivalent of the following
//calling code
// ::EvaluatingEditChecks() = TRUE;
CRreFrameWnd* pRreFrameWnd = ::RreGetMainWnd();
ASSERT (pRreFrameWnd);
pRreFrameWnd->m_bEvaluatingEditChecks = TRUE;
int nEvalState = pEditCheck->m_pExprRoot->Evaluate(pRreDlgEntry);
//::EvaluatingEditChecks() = FALSE;
CRreFrameWnd* pRreFrameWnd = ::RreGetMainWnd();
ASSERT (pRreFrameWnd);
pRreFrameWnd->m_bEvaluatingEditChecks = FALSE;
|
|
|
|
|
The function returns a reference to a variable. So setting the function to true is actually setting the variable it returns to true.
They do it that way becasue it makes generating code from wizards etc. easier. I wouldn't make a practice of that code technique in normal code.
Todd Smith
|
|
|
|
|
hi all,
i have an MSChart control in my application. the values are calculated dynamically after some user input, i have one row (group of data) and several columns. i use a barchart type.
i want to change the color of a specific column if its value exceeds a limit. how do i manipulate the color drawing of a column ? the answer should lie somewhere in the CVc..classes but i m lost there.. any help ?
my error(?) code :
CVcPlot aplot = m_pChart->GetPlot();
CVcSeriesCollection aSerCol = aplot.GetSeriesCollection();
CVcSeries aSeries = aSerCol.GetItem(1); // i have 1 series only
CVcStatLine aStatLine = aSeries.GetStatLine();
CVcColor aColor = aStatLine.GetVtColor();
aColor.Set(120, 120, 120);
and saw no change in the color of the bar..
tia, giorgos
|
|
|
|
|
I´m trying to store a buffer received from a server in a CString.
The buffer contains data of users connected to server.
Everything works fine until i connect 4 users and refresh.
Then an assertion occurs in this line:
csRcv.GetBufferSetLenght(nRecvlenght);
Any Idea???
I´m very on this.....
HELP PLZ!
|
|
|
|
|
Thats a very dangerous function to use. Are you sure, you need to use it. Are you calling ReleaseBuffer anywhere before this line? Have you called GetBuffer? and what about the value of nRecvlength?
Nish
|
|
|
|
|
Hi,
About 8 years ago I used to develop in C++. That was back in the DOS days when Borland Turbo C++ was king. I mention this so you won't laugh when I tell you that for the past number of years I’ve been writing code in VB.
Recently, though, I installed the VC++ and have started to use it for a few DLLs. But now I’m wondering where to begin with developing a GUI in VC++? I went thought the scribble example in MSDN, so I know about Documents, Frames, and Views. But how do you use real controls in a window. Everything I see about controls seems to talk about placing controls in a dialog box. I’m not interested in creating a dialog-based app. I want an MDI app with child windows but I don’t know how to add controls to a child window. Could someone give me a few pointers? Maybe a web page that explains this.
Thanks!
Carl
|
|
|
|
|
Derive your view from CFormView
Or manually create your controls using CreateWindow,CreateWindowEx
Nish
|
|
|
|
|
MFC has a special view type called CFormView, this is basically a dialog inside a view. Search http:\\msdn.microsoft.com for more info.
Michael
|
|
|
|