|
I am automating MS-Word from my MFC application. My application can get the number of characters currently in the document, the number of sentences, praragraphs e.t.c. For these statistics, various functions are exposed by the Word Automation interface like GetCharCount(), GetWordCount() e.t.c
I want to find out that how many characters in the document are in bold and how many characters are in italics. Is there any way to calculate these values ?? What i am thinking is to iterate each character, but i also donn't know that how can we iterate each character of the document.
Imtiaz
|
|
|
|
|
I don't know about the automation part, but in MS Word you can search with wildcards and format, so if you can automate that, instead of iterating through each character you could specify a search for [*, use wildcards, bold] and repeat the search counting the hits.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I am in the mist of editing a legacy program which output the report to words format. I am require to add in images, but I am unable to set the position of the images. I am able to add the images but all at (0,0) range.
i'm using the following codes
_Document oDoc;
Shapes oShape;
oShape = oDoc.GetShapes();
oShape.AddPicture
// v is suppose to be the indicator of the top and left points
tagVARIANT v;
v.lVal = v.intVal = v.iVal = v.fltVal = 200;
("C:\\Logo.JPG",vtFalse,vtTrue,&v,&v,vtOptional,vtOptional,vtOptional);
the image still appear at point (0,0)
Is it correct to use Shapes class or should I use InlineShapes
can someone please advise me... where have I gone wrong
Thomas
|
|
|
|
|
Barm wrote:
tagVARIANT v;
v.lVal = v.intVal = v.iVal = v.fltVal = 200;
tagVariant is an union . That means all lVal , intVal , iVal , etc. share the same space, so assigning multiple fields makes no sense. You should assign only one of the value fields, and set the vt member to indicate which is the one you are using. As you didn't initialize vt , it must have remained as zero, which indicates an empty variant (i.e.: v.vt == VT_EMPTY ), and that may be why the image remains at 0,0
Try the following:
tagVariant v;
v.vt = VT_I4;
v.lVal = 200;
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
|
problem for position solved but I encounter another problem, i need to put the images into different cells in a table and some images are to be outside the table. The codes is able to work but all the images are inserted into the first cell in the first table. Is there a way to set the position with respect to the a cell?
Thomas
|
|
|
|
|
Using VC6 on Win2k...
I have a test app with the following characteristics:
- Dialog-base app with MFC dynamically linked
- Dialog has no titlebar, but it does have a thin border.
- There is a single static bitmap control on the dialog
- I created a CStatic-derived class to allow it to draw a DIB on the dialog using Chris Maunder's CDIBSectionLite class
- I put the derived control inside the AFX_DATA macros of the dialog
- there is no dynamic allocation going on in my app
When I shut a test app down, I get the following in the output window:
The thread 0x394 has exited with code 27 (0x1B).
The program 'K:\TEST APPS\bmploader\Debug\bmploader.exe' has exited with code 27 (0x1B).
Does anyone know why, and how to clean this up?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Is there only one thread ? You're just getting this in the UI ? Are you sure it means anything important ? I doubt it does.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
John Simmons / outlaw programmer wrote:
I have a test app with the following characteristics:
- Dialog-base app with MFC dynamically linked
[...]
When I shut a test app down, I get the following in the output window:
The thread 0x394 has exited with code 27 (0x1B).
The program 'K:\TEST APPS\bmploader\Debug\bmploader.exe' has exited with code 27 (0x1B).
Does anyone know why
I think it means you closed the dialog with the Esc key (scan code of Esc is 0x1B = 27).
John Simmons / outlaw programmer wrote:
and how to clean this up?
These messages only appear in the output window in the IDE. Unless you need to use the app's exit code for something else, I wouldn't worry about it.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
I think it means you closed the dialog with the Esc key (scan code of Esc is 0x1B = 27).
That's probably it. I don't have any buttons on the dialog box, so I have to press escape to get out of it.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote:
The thread 0x394 has exited with code 27 (0x1B).
The program 'K:\TEST APPS\bmploader\Debug\bmploader.exe' has exited with code 27 (0x1B).
When you shut down the application using Alt+F4 instead, notice that the thread exists with a code of 2, which is Cancel/Close. What you are seeing is normal.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I write an plugin component for firefox 1.0,which contains an dialog.on the dialog,there 's an editbox with password style checked.now i run the component
on Windows XP.when i put password into the editbox ,It shows "||||||" instead of "*******"or".......". on windows 2000,It works normal.
that's strange.
anyone can help me?
Mike Shen
|
|
|
|
|
Maybe this note in the help for Edit Control Styles[^] can help:
ES_PASSWORD
Displays an asterisk (*) for each character typed into the edit control.
This style is valid only for single-line edit controls.
Windows XP: If the edit control is from user32.dll, the default password character is an asterisk. However, if the edit control is from comctl32.dll version 6, the default character is a black circle.
To change the characters that is displayed, or set or clear this style, use the EM_SETPASSWORDCHAR message.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
thanks for you reply.
Maybe there's some misunderstanding.I set single line editbox style to ES_PASSWORD,then it should show asterisk(*) or black circle (.). but in mozila
and firefox explore on windows XP,It shows "|",don't you think it is unexpectable?
what cause this happen? do mozila and firefox not match XP platform well?
|
|
|
|
|
I don't know. But you may test the dialog outside of the browser to see if it's a problem that only occurs inside the browser or not.
You may also try explicitly setting the password char and see if that helps or not in your case.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
yeah, i've seen this too, but once the page is completely loaded, the asterisks are well displayed...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Folks here is another one,
I do all operations on bitmaps within .NET DLL project, while the DLL is being used by a C++ project(windows project to be exact). When I perform operations on bitmaps I have to pass locations of them from C++ project to .DLL.
BSTR bla(L"C:\\temp\\TestDLL1.bmp_BGL.bmp");
BSTR bla1(L"C:\\temp\\TestDLL1.bmp_GDI.bmp");
HRESULT hr = myobject->Load2BitmapsfromFile(bla, bla1, 50, &m);
Vb.NET DLL project is set to recieve these path locations as parameters and based on them create bitmaps and more.
The problem raises when I run my C++ project and debug to realize that the strings used to pass bitmap locations to .DLL are now empty. Thus I got nothing useful from that method in DLL.
Any commnets on this would be helpful.
Thank you,
Sincerely,
Max Pastchenko
|
|
|
|
|
mpastchenko wrote:
Vb.NET DLL project
Why are you being so cruel to C++, to make it talk to VB ? :P
Seriously though, what's the reason for this ? You can write GDI+ code in C++, you don't need .NET at all.
mpastchenko wrote:
The problem raises when I run my C++ project and debug to realize that the strings used to pass bitmap locations to .DLL are now empty.
The strings are constants and they are empty ? Or are you not looking at them properly ? Can the IDE show the contents of a BSTR ? If they are constants, they simply cannot be empty, as far as I can see. Why not debug the dll and see what ends up in VB.NET ? Or just put in a log file or something.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In instead of having next programmer, work with GDI+ and put that constraint on him (this is a only a part of the project that will be used by someone else), I would rather contain all GDI+ in .NET thats why I am using paths (strings). So its easier for someone else, especially if not familiar with GDI+ directly to just say:
LoadANDCompareMaps(bstingpath1, bstringpath2, etc)
The solution to my priblem is quite simple:
I was declaring my binary strings incorrectly
correct syntax:
BSTR bla = SysAllocString(L"C:\\temp\\TestDLL3.bmp_BGL.bmp");
Thank you
Sincerely,
Max Pastchenko
P.S. I debugged on VB side with C++ executable and thats how I found that they were empty. And as far as i see C++ is talking to a .NET DLL which is created by VB.NET
|
|
|
|
|
Hi
I wrote my own custom control (derived form CTreeCtrl) where you can add several buttons (with unique IDs ...). The problem is now: How can I pass the messages (BN_CLICKECKD etc) to the frame window to handle? First they are send to the parent (the custom control) but I can't handle them there because the control doesn't know the IDs off the buttons at compilation time. But the frame (a CFormView) does know so how can I make the custom control pass the messages on to its parent.
I saw this some time before and I think the solution is some change in the PreCreateWindow(..) method but I can't remember (and I can't find the code either)!!
Please help
|
|
|
|
|
Does anyone know of any iSeries AS400 APIs?
|
|
|
|
|
Are you referring to an API on the AS/400 itself, or an API on the PC that can communicate with the AS/400? They are vastly different.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
An API on the PC that can communicate with the AS/400.
|
|
|
|
|
Yep, that's the one I use every day. What exactly did you want to know? If you have the Client Access CD, just install it on your PC and it will ask you if you want the toolkit. Doing so will give you the necessary lib, dll and h files that you can use to build with.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi and thanks!!
My problem is this:
I'm trying to send the bytes of a file from server to client via TCP packets, using a character array. I am using a CFile to read the file on server side, and write to it on client side.
I do this on server side:
CFile sourceFile;
char data[4096];
int read = sourceFile.Read(data, 4096);
send(clientsock,data,read, 0);
And on client side,
int ret = recv(serversock, message, messagelen, 0);
For some reason, although the 'read' int says it reads 738 bytes, which is correct, the 'data' character array only contains 4 bytes, the first four of the file. The client only receives the first 4 bytes also. What might I be doing wrong?
The file I'm sending is jpg image format.
Thanks a lot!
Kelly Ryan
|
|
|
|