|
Hey thanks! Much appreciated Umm, forgive my ignorance, though, I get an undeclared identifier error on the W2T macro. I assume I'm missing a header file or something?
NATHAN RIDLEY
Web Application Developer
generalgherkin@yahoo.com
|
|
|
|
|
Nathan Ridley wrote:
I assume I'm missing a header file or something?
yep, atlconv.h
Make sure you read my reply to my reply (I hope that makes sense ) for some stuff that I forgot about in my first reply.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
[Short Homer Scream]AARGH![/Short Homer Scream]
I get these errors...
D:\cdev\XMLTest\XMLTestDlg.cpp(195) : error C2065: '_lpw' : undeclared identifier
D:\cdev\XMLTest\XMLTestDlg.cpp(195) : error C2440: '=' : cannot convert from 'unsigned short *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\cdev\XMLTest\XMLTestDlg.cpp(195) : error C2065: '_convert' : undeclared identifier
My code looks like this:
void CXMLTestDlg::OnButton1()
{
IXMLHTTPRequest* pIXMLHttpRequest = NULL;
HRESULT hr = CoInitialize(NULL);
hr = CoCreateInstance( CLSID_XMLHTTP,
NULL,
CLSCTX_INPROC_SERVER,
IID_IXMLHTTPRequest,
(void**)&pIXMLHttpRequest);
BSTR bstrString = NULL;
try
{
hr = pIXMLHttpRequest->open(_bstr_t(_T("GET")),
_bstr_t(_T("http://top01wdt1:8090/test.htm")),
_variant_t(VARIANT_FALSE),
_variant_t(""),
_variant_t(""));
if(SUCCEEDED(hr)) {
BSTR* pbsz = NULL;
hr = pIXMLHttpRequest->get_responseText(pbsz);
LPCTSTR lpsz = W2T(*pbsz);
CString x(lpsz);
m_szOutput = test;
UpdateData(FALSE);
}
}
catch(...)
{
MessageBox("Failure!");
}
}
NATHAN RIDLEY
Web Application Developer
generalgherkin@yahoo.com
|
|
|
|
|
Oops. Forgot one thing.
put USES_CONVERSION; at the top of your function. This macro declares the variables that the W2T macro (and all the other ATL conversion macros) use internally.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
cool, thanks for the help!
NATHAN RIDLEY
Web Application Developer
generalgherkin@yahoo.com
|
|
|
|
|
In the code I've posted (in the message that this message is a reply to) there is a bug in the bold section which causes an exception to occur. It says I'm trying to write to memory address 0x00000000, and only occurs once I try to read the value of pbsz. Can you see any obvious points where this could be caused?
NATHAN RIDLEY
Web Application Developer
generalgherkin@yahoo.com
|
|
|
|
|
Use WideCharToMultiByte() API
CodeTheDreams();
|
|
|
|
|
Short answer: You can assign a BSTR to a CString , since CString has a constructor that takes a Unicode string pointer.
Long answer: See my guide to string classes[^] for all the details
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
hi there..
i wanted to know if some one had a precise idea about what the macros DECLARE_OLECTLTYPE and DECLARE_OLECREATE_EX do in an activeX controls..
thanks
safee
|
|
|
|
|
hello.......how to get Child frame's handles from Main frame in MDI application?
Thanxs.....
C.R.Naik
|
|
|
|
|
You can use code similar to this. Basically, you go through each of the application document templates, to get each of the open documents. For each document (which could have multiple views), you go through each of the views, and then get the parent frame.
POSITION posTemplate = theApp.GetFirstDocTemplatePosition();
while (posTemplate)
{
CDocTemplate * pTemplate = theApp.GetNextDocTemplate(posTemplate);
POSITION posDocument = pTemplate->GetFirstDocPosition();
while (posDocument)
{
CDocument * pDocument = pTemplate->GetNextDoc(posDocument);
POSITION posView = pDocument->GetFirstViewPosition();
if (posView)
{
CView * pView = (CSpecExView *)pSpecExDoc->GetNextView(posView);
CFrameWnd * pChildFrame = pView->GetParentFrame();
}
}
}
Hope this helps!
|
|
|
|
|
I created an app using the VC App Wizard that is an ole client using active documents. I can insert an Excel spreadsheet and put stuff into the spreadsheet manually...fine and good. I would like to be able to programmatically set the value of cells in the spreadsheet...nothing more.
Can anyone help me with this, what I hope to be, easy problem? I know diddly about ole.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
yes you can do that..and do that rather easily..
what you have to do is to find the method in the exposed class which says something like SetCell(int row, int col, variant val)
and here u are ...u pass the cell coordinates as well as the value and you are done..
regards
safee
|
|
|
|
|
Here's an example:
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtTrue((short) TRUE),
vtFalse((short) FALSE);
CString strText;
if (app.CreateDispatch("Excel.Application") == TRUE)
{
app.SetVisible(TRUE);
books = app.GetWorkbooks();
book = books.Add(vtOptional);
sheets = book.GetSheets();
sheet = sheets.GetItem(COleVariant((short) 1));
range = sheet.GetRange(COleVariant("A1"), COleVariant("A1"));
m_ebCellA1.GetWindowText(strText);
range.SetValue(COleVariant(strText));
range = sheet.GetRange(COleVariant("A2"), COleVariant("A2"));
m_ebCellA2.GetWindowText(strText);
range.SetValue(COleVariant(strText));
range = sheet.GetRange(COleVariant("A4"), COleVariant("A4"));
range.SetFormula(COleVariant("=A1 + A2"));
}
I have a dialog with two edit boxes where I enter a number into each. These two numbers are plugged into two cells in Excel and their sum is plugged into a third cell.
|
|
|
|
|
Thanks for the reply. There seems to be something missing...or I am ignorant...or both
Where are these defined?
DavidCrow wrote:
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
They come from Excel9.h. This file, and its .cpp companion, are created by importing from the Excel type library.
|
|
|
|
|
Thanks. That works well, however it loads the excel app to do the operations. Do you know how I can use the same methodology to set the cells in the ole object that is inserted in my client application?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
I've not tried anything embedded.
|
|
|
|
|
In case you are interested, I found out how to do what I wanted.
clickety[^]
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hello,
I'm the designer of a small independent game called Psyscapes, and the current programmer for it (C++) has been unable to complete his task. However, he has completed about half of it, and has agreed to pass along his work to someone else and answer any questions they may have about the source code. Payment for this project will be done by a percentage of the profits after the game is complete, and there will be a contract for this project (sendable through the internet, if you can attach a picture of your signature).
Please email mail@psyscapes.com with some information about yourself if you're interested. Professional experience is a plus, but the most important thing is how quick and efficient you'll be able to get it done (expectant fans have already been waiting a long time!). I hope to make the selection by the end of this weekend, so you need to email there by Sunday, or Monday (May 5) at the absolute latest. More details will be given to you once your email is received.
I apologize if this was the wrong place for this post, I don't mean to offend anyone. Anyway, thanks for your time.
--Josh Cronkhite
mail@psyscapes.com
|
|
|
|
|
How about a website for the project? Why don't you register before posting? Are you aware that you are posting a message to the most talented programmers in the world?!?! Unless you pony up some status and can back six figures for the completion of the project, you're wasting your time here. If you want to advertise here, read this[^].
|
|
|
|
|
Give him a break! ;)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
42696C6C2053657267696F20284E4F542129 wrote:
Why don't you register before posting?
You too
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
hey dude, lose the ermine robes and walk with the peasants.
|
|
|
|
|
I am having problem registering msvcrt.dll in a client PC. An error messages says:
--------------------------
msvcrt.dll was loaded, but the DllRegisterServer entry point was not found.
DllRegisterServer may not be exported, or a corrupted version of msvcrt.dll may be in memory. Consider using PView to delete and remove it.
--------------------------
I have the same problem when registering p2sodbc.dll for Crystal Reports.
I am not sure registering msvcrt.dll is neccessary for a Windows 95 or Windows 2000 PC. Also I don't believe the files are corrupted since I copied them right from my PC.
-Elizabeth
Eilzabeth
|
|
|
|