|
Hello All,
I used wab32.dll in my application for reading email address from outlook express wab file. the application is working fine. but when i tried to convert the application into an ocx control. I am getting error at hr=GetContentsTable( MAPI_BEST_ACCESS ,&lpAB);
ULONG ulObjType=0;
LPMAPITABLE lpAB=NULL;
LPTSTR lppszArray=NULL;
ULONG cRows = 0;
LPSRowSet lpRow = NULL;
LPSRowSet lpRowAB = NULL;
LPABCONT lpContainer = NULL;
int cNumRows = 0;
int nRows=0;
HRESULT hr = E_FAIL;
ULONG lpcbEID;
LPENTRYID lpEID = NULL;
// Get the entryid of the root PAB container
//
hr = m_lpAdrBook->GetPAB( &lpcbEID, &lpEID);
if(HR_FAILED(hr))
goto exit;
ulObjType = 0;
// Open the root PAB container
// This is where all the WAB contents reside
//
hr = m_lpAdrBook->OpenEntry(lpcbEID, (LPENTRYID)lpEID, NULL, MAPI_BEST_ACCESS , &ulObjType, (LPUNKNOWN *)&lpContainer);
m_lpWABObject->FreeBuffer(lpEID);
lpEID = NULL;
if(HR_FAILED(hr))
goto exit;
// Get a contents table of all the contents in the
// WABs root container
//
if(ulObjType==MAPI_ABCONT)
{
hr = lpContainer->GetContentsTable( MAPI_BEST_ACCESS ,&lpAB);
if(HR_FAILED(hr))
goto exit;
After GetContentsTable i am unable to load the contents of the table in the lpAP. This code of sample works fine in standard exe.
Can any one please help me in getting out of this problem.
Thankyou,
sirisha.
sirisha
|
|
|
|
|
Hi guys,
Does anyone have an idea how to get the original HTML file source from a running Internet Explorer instance?
What I currently have is a BHO that obtains the BODY element from the DOM (using IWebBrowser2 and IHTMLDocument2). The problem is: the content of the tag is altered (it's not the same as in the source HTML file).
And, please, don't tell me to use URLDownloadToFile() - that's not what I want. I do not want to download the file once more, I want the way to use the allready downloaded copy (the one IE is using).
Just for the record: I've allready read :
http://www.codeguru.com/forum/showthread.php?t=227360&page=1&pp=15[^]
|
|
|
|
|
To get the original HTML you can querry for interface IPersistStreamInit on the IHTMLDocument2 interface and then call its Save() method passing to it an IPersist interface. To create the IPersist interface needed for calling this method, use function CreateStreamOnHGlobal() and then after calling the Save() method use function GetHGlobalFromStream() to get the global memory handle containing the original HTML data.
Not only will this approach give you the original HTML but it will also retrieve it much faster than the DOM BODY element approach for large HTML documents with many elements. Be aware that if the document in IE is not an HTML document, but instead a plain text document, using this approach or the DOM BODY approach will not return the original text document but a HTML wrapper of it which can easily be converted back to its original text.
|
|
|
|
|
Thanks a lot. I'll try it out.
Bill Rider wrote:
Be aware that if the document in IE is not an HTML document, but instead a plain text document, using this approach or the DOM BODY approach will not return the original text document but a HTML wrapper of it which can easily be converted back to its original text.
I didn't know this (of course). It may come handy in future. At the moment, I'm checking if the document in IE is HTML, and take no action if it is not.
|
|
|
|
|
Hi
I am using IHTMLElement interface to extract the text control present from the HTML page.My COde is like this
CComQIPtr<ihtmldocument3> pHTMLDocument;
CComPtr<ihtmlelement> pHTMLElement;
CComPtr<idispatch> pDispatch;
CComBSTR bstrLoginID(L"sec");
BSTR bstrLoginData;
hr=m_spWebBrowser2->get_Document(&pDispatch);
pHTMLDocument=pDispatch;
if(SUCCEEDED(hr))
{
hr=pHTMLDocument->getElementById(bstrLoginID.m_str,&pHTMLElement);
if(SUCCEEDED(hr) && pHTMLElement)
{
hr=pHTMLElement->get_innerText(&bstrLoginData);
OutputDebugString("DATA");
OutputDebugStringW(bstrLoginData);
}
}
Here I am able to get the text...Help
VikramS
|
|
|
|
|
Any url links or book/s for the above ?
|
|
|
|
|
This[^] one's good.
--
...Coca Cola, sometimes war...
|
|
|
|
|
I have been using WTL for about a year now and haven't made any MDI apps yet.
I have found many good articles here on CP about how to do this and that with WTL but I haven't found anything showing how to make a usefull MDI application (for my needs).
What I'm trying to make myself is an MDI text editor (yes the world needs more of those ).
MTPad from the WTL7 samples has almost all I need but it's not MDI
What would be perfect for me was if somebody had made an MDI version of MTPad. That could give a lot of hints about the differences between SDI and MDI.
I even think it would be great for others too if it was posted as an article here on CP (I will post the suggestion on the right message board too).
I'm particularly interested in seeing how to handle printing and the find-text-dialogs in an MDI application.
Any help appreciated.
--------------
Janman.
|
|
|
|
|
Hi
I'm trying to open multiple files with the CFileDialog of the WTL. By passing "OFN_ALLOWMULTISELECT" to the constructor I can select multiple files when the dialog opens. Unfortunalely I cannot retrieve those filesnames later?
Does anybody have a solution?
Thanks
Markus
|
|
|
|
|
My problem is simple... the
in>>hex>>a line works in main, but not on the constructor of my token object.
If I make the class token: public string instead of stringstream ist works.
Where am I messing this ??
Here is the code
#include <string>
#include <fstream>
#include <iostream>
#include <cstdlib>
#include <sstream>
using namespace std;
class token: public stringstream
{
public:
token(ifstream& in)
{
int a;
in>>hex>>a;
};
~token(void){};
bool matches(token model);
};
int main()
{
int a;
ifstream in("c:\\mestrado\\assembler\\tokens.txt");
in>>hex>>a;
}
|
|
|
|
|
Well, dunno if i can rely on your sample, but "int a;" .. the variable is uninitialed.
secundo, i dont see where/how you create your token object or how.
Give a more complete sample and we might be able to help.
|
|
|
|
|
How do you create a vector of pointers to objects that have multiple inheritance?
R. Morrison
|
|
|
|
|
What's the best IDE to use for developing WTL apps? I'm using MSVC .NET 2002 at the moment, but it doesn't understand the extended message map macros, so the class view is messed up. Anyone know if MSVC 2005 will be better?
|
|
|
|
|
I am now working to read & write a very BIG size file. I have to read the file by taking chunk of 512 KB at a time, but i only knows two way of reading the file.
1. Read text file character by charter;
2. Read text file record by record;
Now i want help from U that how can i read the text file by giving the
block size which describe how much bytes will be readed at one time. please
send (if possible) me a sample code segment which describes the process of
reading & witing files in chunks.
Thanx & waiting for your early reply at tzubairy@yahoo.com
With Regards,
Tariq
|
|
|
|
|
You could just open an ifstream in binary mode, then just do a read().
char buff[512] = {'\0'};
ifstream inFile("C:\\test.dat", ios::binary);
while(! inFile.eof())
{
inFile.read(buff, sizeof(buff));
memcpy(&SomeStruct, buff, sizeof(buff));
}
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Actualy i have an error when toolbar.bmp have 256 or grater colors. WTL aplication just asserts on loading bitmap.
how to create toolbar with "more colors", not with 16 color !?
----------------------------
never stop coding.
|
|
|
|
|
i do it only with editing atlframe.h
i changed some code, if we are not in WIN_CE block
[code]
/*
ATLASSERT(false);
TBADDBITMAP tbab = { 0 };
tbab.hInst = hInst;
tbab.nID = nResourceID;
::SendMessage(hWnd, TB_ADDBITMAP, nBmp, (LPARAM)&tbab);
*/
HBITMAP hBmp = LoadBitmap( hInst, MAKEINTRESOURCE(nResourceID) );
HIMAGELIST hImageList = ImageList_Create( pData->wWidth, pData->wWidth,
ILC_COLOR32, pData->wItemCount, 0 );
ImageList_Add( hImageList, hBmp, (HBITMAP)NULL );
::SendMessage(hWnd, TB_SETIMAGELIST, 0, (LPARAM)hImageList);
[/code]
====================
maybe there is some other way ?
----------------------------
never stop coding.
|
|
|
|
|
Yes, I did it quite the same way
|
|
|
|
|
Hello, I'v a problem. I want to make a toolbar, plugin or addin for outlook express. I don't know how to do this. If anybody knows then please do let me know.
What is the best way to find anykind of information, for the new kind of project you have to works for. e.g. I just wrote following in google.
Addin outexpress VB 6 or VC 6
I'll be very thankful for the help.
Try to go in 1 direction.
|
|
|
|
|
Hello, I'v a problem. I want to make a toolbar, plugin or addin for outlook express. I don't know how to do this. If anybody knows then please do let me know.
What is the best way to find anykind of information, for the new kind of project you have to works for. e.g. I just wrote following in google.
Addin outexpress VB 6 or VC 6
I'll be very thankful for the help.
Try to go in 1 direction.
|
|
|
|
|
In Alex's excellent article, source code is provided to build and test a COM server. The test used VBScript access/use the component and everything worked as it should.
I then tried testing it using VB6, but got a run-time error (Run time error 249: ActiveX component can't create object) during the form load, which is where I create the object.
What's up?
Here's my code;
Option Explicit
Public theobj As ServicesManager.CServicesMgr
Private Sub Command1_Click()
theobj.Start ("RobService")
Text1.Text = "Started"
MsgBox ("Howdy")
theobj.Stop ("RobService")
End Sub
Private Sub Form_Load()
Set theobj = CreateObject("ServicesManager.CServicesMgr")
End Sub
|
|
|
|
|
Has anybody figured out a way to preallocate a multimap?
|
|
|
|
|
Do you mean to allocate it at compile time? Or do you mean that you know how many entries you will add, and you want to reserve the memory ahead of time?
If the former, I don't believe it can be done.
If the latter, I would suggest making the values pointers, e.g.,
map<string, cfoo*="">. You could potentially preallocate the memory for
CFoos (simple if it is just a struct, otherwise more work). The
memory for the nodes would not be preallocated, but the nodes would
be fairly small.
|
|
|
|
|
Well, I was unaware of the following article when I replied earlier. You may be well aware of it. It applies to maps, but I don't know whether multimaps are supported, I have not spent the time to check.
For what it is worth: http://www.codeproject.com/vcpp/stl/PGIL.asp
|
|
|
|
|
I think you'd have to hook in your own allocator for that.
The std::[multi]map s are implemented as red/black binary trees IIRC, so they are very dynamic in structure, just like a linked list. Hence you don't see a reserve() method in their interfaces.
hashmaps are by definition preallocated, but I'm not sure if hashmaps are part of STL yet.
--
Denn du bist, was du isst!
Und ihr wisst, was es ist!
Es ist mein Teil...?
|
|
|
|