|
Ok so i can't see why i can't get that bit to work.
How about reading it back in? (please don't just say reverse it)
I create an object of the class
Do i then go through and push_back (re create) from my basic types?
Does that mean i need to store the amount of records for later?
STL was supposed to make my life easier - lol
thanks
Carl
|
|
|
|
|
crandall wrote:
(please don't just say reverse it)
Well, you could either store the number of records as you mentioned, or you could just process until you reach eof(). Have a look at my CDataFile class[^] to see how I do it.
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
thanks a lot for your help
|
|
|
|
|
|
Thanks Todd. I have managed to get this thing working without any testing code but i will definitely look at the code, it seems really good plus i'm not using xml which could be of benefit later. - Cheers
Carl
|
|
|
|
|
Hello, I am interested in
creating a standard cookie file from
a .exe application, that will later
be consumed by a intranet
application via the ie browser.
(I'd like to be able to generate
client side cookie files without without actually
running the ie browser).
is this possible from a client side only app (.exe)?
any help is appreciated.
sas
|
|
|
|
|
|
thanks. I'll take a peak
now [cookie newbie).
sas
|
|
|
|
|
Reposted also in VC++ forum, cause I'm not sure which forum this question is for. So:
I have a lot of different C++ objects with members. String ints etc.
Objects get populated from database. Used to do it using MFC ODBC classes. Then I decided to go OLE DB. Wow! So. Now instead of CRecordset we use CAccessor<> , right? To map members to fields now I have to use TCHAR or CComBSTR for strings, right?
But I'd like to keep my objects as CString or std::string . I don't want to change all my code to operate with CComBSTR and I don't want make parallel just members to transfer data from database to my members. What do I do then? Is there a way to make COLUMN_ENTRY to accept CString or std::string ? Or somehow make an automatic transfer from one global CComBSTR (that would be used to retrieve the data) to those members?
Confusing?
|
|
|
|
|
Hey!
every one
I want to convert a Dialog based MFC application that contains a Microsoft Web Browser Control and the standart buttons on the dialog into an ATL based Composite Control.
If YES... then how?
Thanks and regards.
Zubair.
|
|
|
|
|
It does not free the HIMAGELIST in the destructor. I've become painfully aware of this today. I don't know if it's by design or not, but it's highly annoying!
--
...Coca Cola, sometimes war...
|
|
|
|
|
Looking in the WTL mailing list archives...(from April 2001) it looks like it was a bug that was left in for 'backward compatibility'. Quoting Nenad:
Changing this now would mean that the class with the
same name (CImageList) would have a different behavior, and that is why
that wasn't done. I would do it, but I am afraid that would break
existing code in a bad way.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi All
I am working on DB2 backup utility using Vendor APIs in the form of shared library. But when i call it using control center or through command line interface (CLI)
through this command
db2 => BACKUP DATABASE TOOLSDB LOAD /home/shitij/harpreet/libvend OPEN 1 SESSIONS WITH 1 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING
where “/home/shitij/harpreet/libvend” is the path of the shared library.
I receives following error:
SQL1224N A database agent could not be started to service a request, or was
terminated as a result of a database system shutdown or a force command.
SQLSTATE=00000
it fails in :
int sqluvint ( struct Init_input *in, struct Init_output *out, struct Return_code *return_code)
function call .
May be i am not able to initialized the “struct Init_output” structure properly, specially “void *pVendorCB “part of this structure.
But I am very much sure that sqluvint is called and it is known through log generated from this function.
Can any body help me out to overcome this problem?
Thanks a lot
|
|
|
|
|
Do you know where to find information(a tutorial for example) on how to design STL-like containers(with their respective iterators) in order to be used with the algorithms of the STL library? Which compiler is best when you need ISO C++ and (as full as can be) STL support?
Thank you!
|
|
|
|
|
This[^] contains a perfect reference on STL - both for users and implementers. He's one of the guys behind STL as well, so he's an authority.
--
...Coca Cola, sometimes war...
|
|
|
|
|
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;
}
|
|
|
|