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

C / C++ / MFC

 
GeneralRe: Outlook Events - Last -Contact remove does not fire Pin
derzellner15-Dec-03 21:06
derzellner15-Dec-03 21:06 
GeneralMFC/C++ caption change SetWindowText() Pin
frexxx15-Dec-03 4:49
frexxx15-Dec-03 4:49 
GeneralRe: MFC/C++ caption change SetWindowText() Pin
David Crow15-Dec-03 6:45
David Crow15-Dec-03 6:45 
GeneralRe: MFC/C++ caption change SetWindowText() Pin
frexxx15-Dec-03 8:00
frexxx15-Dec-03 8:00 
GeneralRe: MFC/C++ caption change SetWindowText() Pin
David Crow15-Dec-03 8:03
David Crow15-Dec-03 8:03 
GeneralA going to lose focus problem Pin
morefalt15-Dec-03 4:28
morefalt15-Dec-03 4:28 
GeneralRe: A going to lose focus problem Pin
jhwurmbach15-Dec-03 4:53
jhwurmbach15-Dec-03 4:53 
GeneralHelp! dev studio add in problem! Pin
YaronNir15-Dec-03 3:08
YaronNir15-Dec-03 3:08 
Hi all,

I've created new add in using the dev studio add in wizard.

i have only 1 command method there that does this:

STDMETHODIMP CCommands::My567CommandMethod() 
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	CWinApp* pApp = AfxGetApp();
	ATLASSERT(NULL != pApp);
	if (NULL == pApp)
	{
		return E_FAIL;
	}

	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;
		}
	}

	if(szWorkspace.IsEmpty())
	{
		return E_FAIL;
	}
	
	return S_OK;
}


the code above, just want to find the *.dsw file name.
i took it from the project "restore class view" appeared here in code project.....

in debug mode the value of POSITION posdt is null, therefor it doesn't find the file. when i tried to debug the project "restore class view"
it did had a value and did returned the proper dsw file.....

can any1 help me here???

thanks

p.s - here is a link to the "restore class view" project

http://www.codeproject.com/macro/restoreclassviewaddin.asp

Yaron

Ask not what your application can do for you,
Ask what you can do for your application
Generalneed some help for MATLAB C++ Pin
Vincent Sim15-Dec-03 1:41
Vincent Sim15-Dec-03 1:41 
GeneralRe: need some help for MATLAB C++ Pin
JWood15-Dec-03 15:43
JWood15-Dec-03 15:43 
Generalkodak imgedit Pin
satadru15-Dec-03 0:30
satadru15-Dec-03 0:30 
GeneralRe: kodak imgedit Pin
Michael P Butler15-Dec-03 0:37
Michael P Butler15-Dec-03 0:37 
GeneralRe: kodak imgedit Pin
satadru15-Dec-03 16:42
satadru15-Dec-03 16:42 
QuestionDetecting Resolution Change? Pin
Dov Sherman14-Dec-03 23:55
Dov Sherman14-Dec-03 23:55 
AnswerRe: Detecting Resolution Change? Pin
satadru15-Dec-03 0:27
satadru15-Dec-03 0:27 
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 
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 

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.