Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Detecting Resolution Change? Pin
Michael P Butler15-Dec-03 0:35
Michael P Butler15-Dec-03 0:35 
GeneralRedrawing window -help reqd Pin
satadru14-Dec-03 23:09
satadru14-Dec-03 23:09 
GeneralRe: Redrawing window -help reqd Pin
Steen Krogsgaard15-Dec-03 1:45
Steen Krogsgaard15-Dec-03 1:45 
QuestionCFileDialog have a preview function? Pin
Grrrr14-Dec-03 22:40
Grrrr14-Dec-03 22:40 
AnswerRe: CFileDialog have a preview function? Pin
Ravi Bhavnani15-Dec-03 7:19
professionalRavi Bhavnani15-Dec-03 7:19 
GeneralDev Studio Add-in question Pin
YaronNir14-Dec-03 21:59
YaronNir14-Dec-03 21:59 
GeneralRe: Dev Studio Add-in question Pin
Roman Keskenti [SmoCoder]14-Dec-03 22:16
Roman Keskenti [SmoCoder]14-Dec-03 22:16 
GeneralRe: Dev Studio Add-in question Pin
YaronNir15-Dec-03 3:26
YaronNir15-Dec-03 3:26 
thanks for reply,

i found a code to get the dsw, it appears in one of the add ins here is code project (in the project http://www.codeproject.com/macro/restoreclassviewaddin2.asp?target=restore%7Cclass%7Cview#xxxx )

here is the code:

CString CCommands::GetWorkspacePath()
{
	CWinApp* pApp = AfxGetApp();

	CString szWorkspace;

	POSITION posdt = pApp->GetFirstDocTemplatePosition();
	while (NULL != posdt)
	{
		CDocTemplate* pdt = pApp->GetNextDocTemplate(posdt);
		if (0 == strcmp("CProjectWorkspaceDocTemplate", 
			pdt->GetRuntimeClass()->m_lpszClassName))
		{
			// found it, grab the first (and only) document:
			POSITION posdoc = pdt->GetFirstDocPosition();
			if (NULL == posdoc) break;

			CDocument* pdoc = pdt->GetNextDoc(posdoc);
			if (NULL == pdoc) break;

			// stash the workspace path+file:
			szWorkspace = pdoc->GetPathName();
			if (0 == szWorkspace.GetLength()) break;
		}
	}

	return szWorkspace;
}


the problem is this code doesn't work for me !!!
the line
POSITION posdt = pApp->GetFirstDocTemplatePosition();


returns null for posdt

i've debug the project restoreclassviewaddin2, and there it works! it returns the full path for the dsw...

can any1 help me here???

thanks in advanced

Yaron


Ask not what your application can do for you,
Ask what you can do for your application
QuestionDCOM/COM+ without ATL? Pin
Kene14-Dec-03 21:32
Kene14-Dec-03 21:32 
AnswerRe: DCOM/COM+ without ATL? Pin
Christian Graus15-Dec-03 8:52
protectorChristian Graus15-Dec-03 8:52 
GeneralRe: DCOM/COM+ without ATL? Pin
Kene15-Dec-03 21:44
Kene15-Dec-03 21:44 
GeneralRe: DCOM/COM+ without ATL? Pin
Christian Graus16-Dec-03 9:12
protectorChristian Graus16-Dec-03 9:12 
AnswerRe: DCOM/COM+ without ATL? Pin
Jörgen Sigvardsson15-Dec-03 10:16
Jörgen Sigvardsson15-Dec-03 10:16 
QuestionHow to change Button background color? Pin
Raima14-Dec-03 20:52
Raima14-Dec-03 20:52 
AnswerRe: How to change Button background color? Pin
Grrrr14-Dec-03 22:55
Grrrr14-Dec-03 22:55 
AnswerRe: How to change Button background color? Pin
Michael P Butler15-Dec-03 0:46
Michael P Butler15-Dec-03 0:46 
QuestionHow to convert the raw WAV data into WMA format? Pin
zhaopzhi14-Dec-03 20:23
zhaopzhi14-Dec-03 20:23 
GeneralMoveFileEx and registry Pin
pranavamhari14-Dec-03 19:38
pranavamhari14-Dec-03 19:38 
GeneralRe: MoveFileEx and registry Pin
David Crow15-Dec-03 6:46
David Crow15-Dec-03 6:46 
QuestionHow to get Full Path of a file by just giving the file name Pin
tvsankar7214-Dec-03 17:57
tvsankar7214-Dec-03 17:57 
AnswerRe: How to get Full Path of a file by just giving the file name Pin
Tim Smith14-Dec-03 18:02
Tim Smith14-Dec-03 18:02 
AnswerRe: How to get Full Path of a file by just giving the file name Pin
Michael Dunn14-Dec-03 18:23
sitebuilderMichael Dunn14-Dec-03 18:23 
GeneralRe: How to get Full Path of a file by just giving the file name Pin
Prakash Nadar15-Dec-03 0:36
Prakash Nadar15-Dec-03 0:36 
GeneralRe: How to get Full Path of a file by just giving the file name Pin
David Crow15-Dec-03 6:49
David Crow15-Dec-03 6:49 
GeneralRe: How to get Full Path of a file by just giving the file name Pin
Prakash Nadar15-Dec-03 16:03
Prakash Nadar15-Dec-03 16:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.