Click here to Skip to main content
15,921,174 members
Home / Discussions / COM
   

COM

 
GeneralRe: Releasing late binding COM object in C# Pin
User 21559715-Apr-08 23:24
User 21559715-Apr-08 23:24 
GeneralRe: Releasing late binding COM object in C# Pin
Crazy Joe Devola16-Apr-08 10:27
Crazy Joe Devola16-Apr-08 10:27 
GeneralRe: Releasing late binding COM object in C# Pin
User 21559716-Apr-08 11:55
User 21559716-Apr-08 11:55 
GeneralProblem with "ActivationContext" and multithreading Pin
Jürgen Jung14-Apr-08 2:35
Jürgen Jung14-Apr-08 2:35 
GeneralRe: Problem with "ActivationContext" and multithreading Pin
Nathan Holt at EMOM16-Apr-08 11:49
Nathan Holt at EMOM16-Apr-08 11:49 
Generalerror MIDL2025 : syntax error : expecting a type specification near "interface_name" Pin
Ganesh_T14-Apr-08 1:59
Ganesh_T14-Apr-08 1:59 
GeneralRe: error MIDL2025 : syntax error : expecting a type specification near "interface_name" Pin
Vi214-Apr-08 19:37
Vi214-Apr-08 19:37 
GeneralReading/Writing the "titel"-information of (office)documents Pin
souljumper12-Apr-08 11:54
souljumper12-Apr-08 11:54 
hi,

i wrote a program that changes the titel of a document.(the text that is displayed in the explorer if you enable the column "titel")

i used this sample-code for doing that: http://www.codeproject.com/KB/files/SummInfoPropSetFile.aspx[^]

so far setting the titel works fine, but if i open the file with word and click on properties i should see the whole text i set. but i only see the first letter of the titel text i wrote in the file.

the explorer displays the name correct and in full length so i'm not sure what i am during wrong, can someone help me?

my code to write the titel of files:
<br />
bool FileManager::setNewTitelOfFile(std::wstring path, std::wstring titel)<br />
{<br />
		 FMTID PropSetfmtid={0xf29f85e0,0x4ff9,0x1068,{0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9 }};<br />
	<br />
	   	 HRESULT hr = S_OK;<br />
	     IPropertyStorage *pPropStg = NULL;<br />
		 IPropertySetStorage *pPropSetStg = NULL;<br />
		 PROPSPEC propspec; <br />
		 PROPVARIANT propWrite;<br />
<br />
		 hr = StgOpenStorageEx( path.c_str(),<br />
								STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,<br />
								STGFMT_ANY, 0, NULL, NULL, IID_IPropertySetStorage,<br />
								reinterpret_cast<void**>(&pPropSetStg) );<br />
<br />
		 if (hr == S_OK)<br />
		 {<br />
			 hr = pPropSetStg->Create(PropSetfmtid,<br />
									  NULL,<br />
									  PROPSETFLAG_DEFAULT,<br />
									  STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,<br />
									  &pPropStg);<br />
<br />
			 if (hr == S_OK)<br />
			 {<br />
 				 propspec.ulKind = PRSPEC_PROPID;<br />
				 propspec.propid  = 0x00000002;<br />
<br />
				 //String umsetzen in TCHAR<br />
				 TCHAR titelAsTCHAR[1024]={0};<br />
				 StringCbPrintf(titelAsTCHAR, 1024, L"%s", titel.c_str());<br />
				 //von TCHAR nach char<br />
				 char titelAsChar[1024] = {0};<br />
<br />
				 WideCharToMultiByte(CP_ACP,<br />
									 NULL,<br />
									 titelAsTCHAR,<br />
									 static_cast<int>(titel.length()),<br />
									 titelAsChar,<br />
									 static_cast<int>(titel.length()),<br />
									 NULL,<br />
									 NULL);<br />
<br />
				 propWrite.pszVal = titelAsChar;<br />
				 propWrite.vt     = VT_LPSTR;<br />
				 		<br />
				 hr = pPropStg->WriteMultiple(1, &propspec, &propWrite, PID_FIRST_USABLE);<br />
<br />
				 if (hr == S_OK)<br />
				 {<br />
 					 pPropSetStg->Release();<br />
					 pPropStg->Release();	<br />
					 return true;<br />
				 }<br />
			 }<br />
			 else<br />
			 {<br />
  				pPropSetStg->Release();<br />
				pPropStg->Release();<br />
			 }<br />
		 }<br />
<br />
		 return false;<br />
}<br />
<br />
<br />
</int></int></void**>

GeneralRe: Reading/Writing the "titel"-information of (office)documents Pin
souljumper13-Apr-08 8:00
souljumper13-Apr-08 8:00 
Questionpassing parameters from c++ to c# COM Pin
Green Fuze9-Apr-08 23:23
Green Fuze9-Apr-08 23:23 
GeneralRe: passing parameters from c++ to c# COM Pin
Vi210-Apr-08 20:31
Vi210-Apr-08 20:31 
GeneralRe: passing parameters from c++ to c# COM Pin
Green Fuze13-Apr-08 3:47
Green Fuze13-Apr-08 3:47 
GeneralRe: passing parameters from c++ to c# COM Pin
Michael Dunn13-Apr-08 12:37
sitebuilderMichael Dunn13-Apr-08 12:37 
GeneralRe: passing parameters from c++ to c# COM Pin
Green Fuze21-Apr-08 4:57
Green Fuze21-Apr-08 4:57 
GeneralPartial Lookups in Excel Macro Pin
Brendan Vogt9-Apr-08 4:19
Brendan Vogt9-Apr-08 4:19 
QuestionDoes anyone have the definition documentation of in Vc++ "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" Pin
larryhcx8-Apr-08 18:36
larryhcx8-Apr-08 18:36 
Questiononly a question about activeX, please help me : ) Pin
sdplox8-Apr-08 16:11
sdplox8-Apr-08 16:11 
QuestionHow to check if a COM DLL was generated from given source code ? [modified] Pin
GuimaSun8-Apr-08 7:20
GuimaSun8-Apr-08 7:20 
Questionhow to defined a defaultvalue interface-function in idl file? Pin
huangdingjun7-Apr-08 17:12
huangdingjun7-Apr-08 17:12 
QuestionHow to add VC++ 6.0 dlls to ASP.NET web application?( through Add ref) Pin
Prabakar3-Apr-08 23:58
Prabakar3-Apr-08 23:58 
GeneralCOM/ATL Event problem [modified] Pin
knuttermutter3-Apr-08 0:21
knuttermutter3-Apr-08 0:21 
GeneralEvents from C# to COM dll (C++) Pin
SteinarAa2-Apr-08 2:58
SteinarAa2-Apr-08 2:58 
GeneralRe: Events from C# to COM dll (C++) Pin
Randor 14-Apr-08 17:10
professional Randor 14-Apr-08 17:10 
QuestionMaking COM introp and calling the method from C# project Pin
Mushtaque Nizamani30-Mar-08 6:06
Mushtaque Nizamani30-Mar-08 6:06 
QuestionDCOM security issue Pin
tony_Udz27-Mar-08 17:46
tony_Udz27-Mar-08 17:46 

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.