Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen15-Feb-04 7:51
Antti Keskinen15-Feb-04 7:51 
GeneralRe: Why this code never works???!?? Pin
YaronNir15-Feb-04 20:58
YaronNir15-Feb-04 20:58 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen15-Feb-04 22:06
Antti Keskinen15-Feb-04 22:06 
GeneralRe: Why this code never works???!?? Pin
YaronNir15-Feb-04 22:10
YaronNir15-Feb-04 22:10 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen16-Feb-04 2:03
Antti Keskinen16-Feb-04 2:03 
GeneralRe: Why this code never works???!?? Pin
YaronNir16-Feb-04 2:15
YaronNir16-Feb-04 2:15 
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen16-Feb-04 2:54
Antti Keskinen16-Feb-04 2:54 
GeneralRe: Why this code never works???!?? Pin
YaronNir16-Feb-04 3:19
YaronNir16-Feb-04 3:19 
this what leads me to the first code i've shown you:

CWinApp* pApp = AfxGetApp();
ASSERT(NULL != pApp);
CString szWorkspace(_T(""));
POSITION posdt = pApp->GetFirstDocTemplatePosition();
while (NULL != posdt)
{
	CDocTemplate* pdt = pApp->GetNextDocTemplate(posdt);
	if (0 == strcmp("CProjectWorkspaceDocTemplate",
 		pdt->GetRuntimeClass()->m_lpszClassName))
	{	
	     POSITION posdoc = pdt->GetFirstDocPosition();
     	     if (NULL == posdoc) break;
  	     CDocument* pdoc = pdt->GetNextDoc(posdoc);
 	     if (NULL == pdoc) break;
 	     szWorkspace = pdoc->GetPathName();
	     if (!szWorkspace.IsEmpty()) 
			break;	
        }
}


this code does not work when i create a dev-studio add in using the wizard of VC++6....but this code does work! when i tried the windows tabs (d/l it from code project), it uses the WWhizIntefaceHelper the has the above method, and if i am placing a break point, at the above code, the line:
POSITION posdt = pApp->GetFirstDocTemplatePosition();

doesn't return NULL....my guess is that this project was not created using the dev-studio wizard.....

can you tell me how it was created then??? it must be COM- ATL - Object right???

if i will solve this, then i will solve my problem...

thanks again
Yaron

Ask not what your application can do for you,
Ask what you can do for your application
GeneralRe: Why this code never works???!?? Pin
Antti Keskinen16-Feb-04 5:53
Antti Keskinen16-Feb-04 5:53 
GeneralRe: Why this code never works???!?? Pin
YaronNir16-Feb-04 6:12
YaronNir16-Feb-04 6:12 
QuestionHow to Insert Table in Rich Text Box Control Pin
Sumit Kapoor15-Feb-04 0:18
Sumit Kapoor15-Feb-04 0:18 
AnswerRe: How to Insert Table in Rich Text Box Control Pin
CodeBrain15-Feb-04 21:57
CodeBrain15-Feb-04 21:57 
GeneralDatabase Problem Pin
Ghasrfakhri14-Feb-04 23:00
Ghasrfakhri14-Feb-04 23:00 
GeneralRe: Database Problem Pin
Manfred Staiger16-Feb-04 0:37
Manfred Staiger16-Feb-04 0:37 
GeneralRe: Database Problem Pin
David Crow16-Feb-04 3:23
David Crow16-Feb-04 3:23 
Generalneed help for sound recording and play back in C/C++ Pin
wenfoo14-Feb-04 22:14
wenfoo14-Feb-04 22:14 
GeneralRe: need help for sound recording and play back in C/C++ Pin
elza14-Feb-04 22:46
elza14-Feb-04 22:46 
GeneralRe: need help for sound recording and play back in C/C++ Pin
wenfoo15-Feb-04 4:05
wenfoo15-Feb-04 4:05 
GeneralRichEdit Pin
Rassul Yunussov14-Feb-04 22:14
Rassul Yunussov14-Feb-04 22:14 
GeneralRe: RichEdit Pin
Michael P Butler15-Feb-04 1:31
Michael P Butler15-Feb-04 1:31 
GeneralControl volume and Microphone of connected USB device Pin
elza14-Feb-04 21:31
elza14-Feb-04 21:31 
GeneralHide Mouse Pin
Andrew Walker14-Feb-04 20:21
Andrew Walker14-Feb-04 20:21 
GeneralRe: Hide Mouse Pin
Robert A. T. Káldy16-Feb-04 7:38
Robert A. T. Káldy16-Feb-04 7:38 
QuestionFile length macro??? Pin
PJ Arends14-Feb-04 13:28
professionalPJ Arends14-Feb-04 13:28 
AnswerRe: File length macro??? Pin
Michael Dunn14-Feb-04 14:10
sitebuilderMichael Dunn14-Feb-04 14:10 

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.