Click here to Skip to main content
15,894,539 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHRESULT variable returning negative value Pin
Member 1449956328-Jun-19 5:58
Member 1449956328-Jun-19 5:58 
AnswerRe: HRESULT variable returning negative value Pin
jeron128-Jun-19 6:15
jeron128-Jun-19 6:15 
GeneralRe: HRESULT variable returning negative value Pin
Member 1449956328-Jun-19 6:57
Member 1449956328-Jun-19 6:57 
AnswerRe: HRESULT variable returning negative value Pin
Victor Nijegorodov28-Jun-19 7:42
Victor Nijegorodov28-Jun-19 7:42 
GeneralRe: HRESULT variable returning negative value Pin
Member 1449956328-Jun-19 8:48
Member 1449956328-Jun-19 8:48 
GeneralRe: HRESULT variable returning negative value Pin
Richard MacCutchan29-Jun-19 7:23
mveRichard MacCutchan29-Jun-19 7:23 
GeneralRe: HRESULT variable returning negative value Pin
jschell30-Jun-19 7:14
jschell30-Jun-19 7:14 
GeneralRe: HRESULT variable returning negative value Pin
Richard MacCutchan30-Jun-19 10:14
mveRichard MacCutchan30-Jun-19 10:14 
AnswerRe: HRESULT variable returning negative value Pin
Stefan_Lang30-Jun-19 22:09
Stefan_Lang30-Jun-19 22:09 
PraiseRe: HRESULT variable returning negative value Pin
Member 144995631-Jul-19 4:05
Member 144995631-Jul-19 4:05 
GeneralRe: HRESULT variable returning negative value Pin
Stefan_Lang1-Jul-19 21:31
Stefan_Lang1-Jul-19 21:31 
GeneralRe: HRESULT variable returning negative value Pin
Member 144995632-Jul-19 6:29
Member 144995632-Jul-19 6:29 
QuestionHook stops application Pin
Mark_G0027-Jun-19 5:34
Mark_G0027-Jun-19 5:34 
AnswerRe: Hook stops application Pin
leon de boer27-Jun-19 7:13
leon de boer27-Jun-19 7:13 
GeneralRe: Hook stops application Pin
Mark_G0028-Jun-19 3:23
Mark_G0028-Jun-19 3:23 
GeneralRe: Hook stops application Pin
Victor Nijegorodov28-Jun-19 4:50
Victor Nijegorodov28-Jun-19 4:50 
GeneralRe: Hook stops application Pin
Mark_G0028-Jun-19 6:41
Mark_G0028-Jun-19 6:41 
GeneralRe: Hook stops application Pin
Victor Nijegorodov28-Jun-19 7:45
Victor Nijegorodov28-Jun-19 7:45 
GeneralRe: Hook stops application Pin
Mark_G0028-Jun-19 9:03
Mark_G0028-Jun-19 9:03 
GeneralRe: Hook stops application Pin
leon de boer28-Jun-19 20:59
leon de boer28-Jun-19 20:59 
GeneralRe: Hook stops application Pin
Mark_G0029-Jun-19 3:36
Mark_G0029-Jun-19 3:36 
QuestionImporting enhanced metafile from ms word to MFC problem Pin
zakomed24-Jun-19 3:55
zakomed24-Jun-19 3:55 
<pre>I am implementing a MS Word report program (in MFC c++) which uses MS Word to produce some kind of report from my program.
A document that is produced is based on a template "mytemplate.dot" or "mytemplate.dotm" .
When creating "mytemplate" in MS Word, I insert an enhanced metafile picture (via clippboard) from my program. This enhanced metafile has a unique signature text "XYZ" (example).
"mytemplate' is stored in both "dot" and "dotm" formats. Any new file created in Word (2007,20016) based on these tempaltes opens correctly and I can see my enhanced metafile picture correctly displayed in Word and my unique "XYZ" is there.
Now I create a "mytemplated" based document in my c++ program (using msword.olb type library).
m_doc = documents.Add(& mytemplate,....)

Then I enumarete through inlineshapes to find the wdInlineShapePicture type (which for the test purpose is the only inlineshape in document). I find the inlineshape object without any problem ("myinlineshape"). I do myinlineshape.Copy() and then use the clipboard to copy the enhanced metafile picture to my c++ program:

OpenClipboard(AfxGetMainWnd()->m_hWnd);
HANDLE hclip = GetClipboardData (CF_ENHMETAFILE ); //first I check if CF_ENMETAFILE is available in the clippboard

everything is OK till now

Now when I use the "mytemplate.dot" format the enhanced metafile in my program is exactly the same as it in Word - (the size and number of segments is exactly the same).
When I use the "mytemplate.dotm" format, the metafile is changed - the size is different, number of segments is suddently quite small (like 19 vs 5000 in original). The picture shows the same contents but it is more like bitmap not a metafile.

Can anybody explain what can be wrong?</pre>
QuestionCStringList on heap Pin
_Flaviu18-Jun-19 23:38
_Flaviu18-Jun-19 23:38 
QuestionRe: CStringList on heap Pin
CPallini19-Jun-19 2:19
mveCPallini19-Jun-19 2:19 
AnswerRe: CStringList on heap Pin
_Flaviu19-Jun-19 19:36
_Flaviu19-Jun-19 19:36 

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.