|
File/New/Select Project Tab/win32 Console Application/click in OK
After this select File view. In the project name, make right click and select Add Files to project, add the files .c, the .h, and the .rc
And Ready.
Carlos Antollini.
|
|
|
|
|
I know how to setup 1 project. I am looking for a way to setup project/workspace files for over 1000 projects. Fairly painful operation if I have to follow the instructions above that many times.
|
|
|
|
|
Have a look at automating such a process, by using the msdev objects.
HTH
Jignesh
|
|
|
|
|
I wrote a simple VBS script to automate such a process. This script assumes there are existing files in a certain directory.
This is what I meant by using msdev automation objects.
<br />
' Usage : cscript createproject.vbs<br />
Set objMSDEV = WScript.CreateObject("msdev.application")<br />
objMSDEV.addproject "test","c:\myprogs", "application", TRUE<br />
objMSDEV.ActiveProject.AddFile "test.cpp"<br />
objMSDEV.ActiveProject.AddFile "test.h"<br />
objMSDEV.ActiveProject.AddFile "test.rc"<br />
objMSDEV.Quit<br />
WScript.Echo "Done"<br />
' -----------------<br />
' End of script<br />
' -----------------<br />
You can tweak this to recurse through numerous folders and add only certain kind of files, or anything else you want.
HTH
Jignesh
|
|
|
|
|
.dsp file is a text which has rather simple structure. You can create empty project and add one or two sources. You'll see that each source file is listed in 'SOURCE=' line. .dsp contains also compiler switches and other stuff which you can just copy - it does not depend on actual source files.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thankyou very much for the useful information.
|
|
|
|
|
Hi,
I have a problem using the mesage "em_charfrompos" and CRichEditCtrl it always returns 0.
Anyone know where i am going wrong?
Cheers Rich
Code Snippet:
CResultsDlg::PreTranslateMessage(MSG* pMsg)
{
if (NULL != m_pToolTip)
m_pToolTip->RelayEvent(pMsg);
if (pMsg->message==WM_MOUSEMOVE &&
pMsg->hwnd==m_note.m_hWnd )
{
long res;
res = m_note.SendMessage(EM_CHARFROMPOS,0,(long)
&pMsg->pt);
|
|
|
|
|
OK, before everyone gets the sh*ts and ignores me I have moved further along than last time I posted about this.
I have read Chris Maunder's article and Knowledge Base Q133275, and have text printing in the middle of the page. Problem is I want to be able to have headers, footers and formatting.
I assume \n and \t will give me newlines and tabs but how do I set the tab stops?
I created an empty SDI application to look at how the printing is done. Looking at the message maps in the View, I found CView::OnFilePrint being called. This is not a member function of the SDI application nor could I find it in MSDN. What is it and what does it do?
How do I build the page in memory with formatting before printing?
How do I get Print Preview in my appliaiton?
My application is dialog based, the data to print is being retrieved from a database and in about 43 hours I have to demonstrate this functionality.
All help greatly appreciated.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
how do I set the tab stops?
You need to use ::DrawTextEx if you want to set tab stops. Note that there's no MFC wrapper for this function. You'll have to pass GetSafeHdc() as 1st arg.
I found CView::OnFilePrint being called. This is not a member function of the SDI application nor could I find it in MSDN.
CView::OnFilePrint is the place where MFC doc/view printing is implemented. It shows the print dialog and has the main print output loop. Overridable CView functions are called from CView::OnFilePrint.
How do I build the page in memory with formatting before printing?
I think you shouldn't 'build the page in memory'. What you should do is:
1) calculate number of pages,
2) call CDC::StartDoc,
3) for each page: CDC::StartPage, page contents printed with various CDC methods, CDC::EndPage.
4) call CDC::EndDoc
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I would like to know if we could use the case method with more than 1 expression. For example, i want to do the same thing for case 1 to 10, another thing for case 11 to 15...
Is it possible?
thanks in advance
gerald
|
|
|
|
|
Yes.
switch(expression)
{
case 1:
makesomething()
break;
case 2:
case 3:
case 4:
makesomething2();
break;
case 5:
.
.
.
}
Cheers!!!
Carlos Antollini.
|
|
|
|
|
I have created a window inherited from CFrameWnd using the create function and I use WS_VSCROLL to stick a vertical scroll bar on the right edge. I want to be able to code the movements of the user clicking on the scroll bar etc and the movement shown withing the bar, my problem is what is the scrollbar called so I can call member functions such as GetScrollPos() etc. I have tried the method OnVScroll and used the pScrollBar parameter but this only comes up with a run time error as if it were null which I think it is.
cheers in advance
Nick
|
|
|
|
|
The pScrollBar is null if the scrollbar is not a control but belongs to a window. Simply use the CWnd::GetScrollPos member function.
void CMainFrame::SomeFunc()
{
...
int pos = GetScrollPos(SB_VERT);
...
}
Oliver
|
|
|
|
|
Hi,,
I like to know how can I name sub-menu's dynamically.
I mean, its name has to be chaged in different stages of the program,,
Any ideas???
thanks
Ehsan Behboudi
|
|
|
|
|
Hi All,
I have a NT Service.I want to shut down the service without the interpretation of SCM.So, I calling CServiceModule::Handler() with opcode "SERVICE_CONTROL_STOP" and the service to shutdown.But, my service is shutting down at the same time it's giving error "Error :2140 An Internal error occured" .
How can I rectify the problem.I would like to know what happens after I say service shutdown.
Thanx in advance for the help.
Regards,
yamini
|
|
|
|
|
Try this:
http://support.microsoft.com/support/kb/articles/Q115/8/29.asp
Kind regards,
Martin
|
|
|
|
|
Hi,
Thanx for the idea.But, I am using ATL Service.I ahve a function CServiceModule::ServiceShutDown() & the function code goes as below.
void CServieModule::ServiceShutDown()
{
SetServiceStatus(SERVICE_STOPPED);
PostQuitMessage(dwThreadID,WM_QUIT,0,0);
}
I am calling this function from CServiceModule::Run() before the Loop and I put a MessageBox in CServiceModule::Handler() case SERVICE_CONTROL_STOP to indicate that the service is stopped.When I try to start the service thro' SCM I am getting MessageBox and also error that "Error :2140 An internal Error occured>".
How can I update the SCM UI and notify that the Service has terminated(When the service terminates instead of Error I need to notify that Service cannot be started ).I mean, how can I terminate the service without such errors as I am using ATL generated Code & I want to achieve the service termination with this ATL Generated Code only.
Thanx.
|
|
|
|
|
SCM shows error 2140 in a case, when your service terminates with 'process return value' equal to 0. You have to find a way, how to return proper value (!= 0) when service process terminates. However, I cannot help you with ATL service class, because I have never used it - sorry.
|
|
|
|
|
I had the same problem.
I made this.
I saw that the problem was that the service didn't stop normally.
You have a thread that is dowing the service but the service didn't know that.
I put saome global variables for that.
For example when I recive the SEVICE_CONTROL_STOP I update a variable like
bRuning = FALSE;
In the Run I always Ask about this variable, I if I find that this variable is FALSE, I go out. (Kill all process like threads, etc, and go out from Run.)
Sometimes the problem is an error in the code that you in debug mode don't see.
I work with trace file and with the Event log for test my Release version. Sometimes I have a mistake.
I hope to Help!!!!
Regards
Carlos Antollini.
|
|
|
|
|
the tree control sends a notify message. How do I extract the TVN_SELCHANGED message from the message? I need somethin like this:
case WM_NOTIFY:
switch (LOWORD(lParam))
{
case IDC_MYTREE:
{
if (HIWORD(lParam) == TVN_SELCHANGED)
dostuff();
break;
}
}
Should be kinda simple, but couldn't find it anywhere in a sample or in the help files
thanks,
WAVK
|
|
|
|
|
lParam points to a NMHDR structure, or a structure that contains NMHDR as a first member. NMHDR has a member named 'code', containing the notification code. Expression that tests the notification code looks like this:
((NMHDR)lParam)->code
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
the NMHDR has to be LPNMHDR in my case, but perfect!
|
|
|
|
|
the NMHDR has to be LPNMHDR in my case
Sure! I've forgot to include '*' in the cast expression. LPNMHDR is just a typedef for 'NMHDR *'.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have list control and its operation is just like the explorer
But when I sorting this list control the directory and files and mixed.
How can I sort it separately like explorer
|
|
|
|
|
Hi,
I'd like to know how can I fill region
with 50% OPACITY white color ?
I need it for hiliting .
Probably the answer is alpha channel functions ( Win2k ) or
OpenGL , but I want to be as simple as possible and working
under Win95 and higher.
Thanks !
|
|
|
|