|
Why not change the typedef
typedef int (__stdcall *FunctionProc)(long, double*, long, long);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
ok, I think I typo-ed somewhere ...
I do this :
typedef int ( __stdcall * FunctionProc)(long , double*, long, long );
and it seems to "work"...
Thank.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
That is perfectly acceptable
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I have an SDI app with a splitter and two views. The left view is a tree view and I'm trying to make the app come up with the last selection visible/active.
The menus/toolbars are indicating that the view is active but the focus/selection mark in the tree control acts as if it is not the active view. Part of the problem may be that the EnsureVisbile() call doesn't actually make it visible (the selection is hidden under a scroll bar). I don't know if that is what is causing the trouble or if the fact that the view really isn't the active view (in terms of mouse, keyboard) is why they EnsureVisible() isn't working (the chicken/egg thing).
I'm using a timer in the MainFrame and forcing the active view after 300ms using SetActiveView(). Is there something else I should be doing to make the view act as if I just clicked on the item? Any idea why the EnsureVisible() isn't placing the selected item within sight?
Thanks.
|
|
|
|
|
Can someone please tell me what i am doing wrong here. I can load the XML file fine but when i select the node that i want and try to retrieve the text, i get nothing back.
std::string value;
HRESULT hr;
MSXML2::IXMLDOMDocumentPtr pDocument;
MSXML2::IXMLDOMNodePtr ptagNode;
_bstr_t mybstrtagResponseKey = "//Response//ResponseKey";
_bstr_t mybstrtagResponseText = "//Response//ResponseText";
_bstr_t myxmlfile = "C:\\sample.xml";
// Create XMLDOMDocument
hr = CoInitialize(NULL);
hr = pDocument.CreateInstance("Msxml2.DOMDocument.4.0");
if (FAILED(hr))
{
}
try
{
// Load xml file.
if (pDocument->load(myxmlfile)!= VARIANT_TRUE)
{
}
else
{
ptagNode = pDocument->selectSingleNode(mybstrtagResponseKey);
//if text exists, get it...
while (ptagNode)
{
value = ptagNode->text;
}
}
}
|
|
|
|
|
It doesn't appear that you're setting the root:
You're not setting the root:
MSXML2::IXMLDOMDocumentPtr plDomDocument = NULL;
MSXML2::IXMLDOMElementPtr pDocRoot;
HRESULT hr = plDomDocument.CreateInstance(MSXML2::CLSID_DOMDocument);
if (SUCCEEDED(hr))
{
BSTR xml = _com_util::ConvertStringToBSTR(response);
variant_t vResult = plDomDocument->loadXML(xml);
if (((bool)vResult) == TRUE)
{
MSXML2::IXMLDOMElementPtr pDocRoot = plDomDocument->documentElement;
CComPtr<MSXML2::IXMLDOMNode> pDisp = pDocRoot->selectSingleNode(_T("Disposition"));
if (pDisp)
...
|
|
|
|
|
By the way, in my code I'm loading the DOM object from memory (via loadXml) while you're doing it from disk (via load). However, the main issue is that you have to set the root and call its selectXXX functions to retrieve the desired elements.
|
|
|
|
|
I learn something new everyday. This is awsesome. I must say, Tom, you really know your XML. I appreciate your help.
I have another question though...
After i retrieve the node value, it will be a blob of data. I have to search this blob and pick out certain pieces of data. I am currently looking to use std::string. Is there a cooler way to search text using XML instead of string? Or is string sufficient for this case?
|
|
|
|
|
Hi!
I'm creating a small program that reads from a text file, using ifstream.
I'm wondering how I can tell the stream to start reading the file from the beginning?
Is this possible or do I have to close the file and reopen it?
This is what I'm doing:
ifstream file(filename);
if(!file.is_open())
{
// Error message.
}
while(!file.eof())
{
file.getline(buf, 200);
// after comes more code that is not relevant here.
}
When I do this getline starts reading line by line.
So how can I tell it to start from the beginning?
Thanks!
|
|
|
|
|
but why do you need to read from beginning again
I love Programming
|
|
|
|
|
Well I need to get some more data from the file.
Is it possible or not?
|
|
|
|
|
You can use the seekg method for that. Something like
ifstream input("C:\\Test.txt");
int txt = 0;
input >> txt;
cout << txt;
input.seekg(0, ios::beg);
input >> txt;
cout << txt;
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
i made a linked list of nodes...! but i need to save my list of nodes on hard disk...
and i need to load this list when i open my program...
(it is a phonebook program in console application)
|
|
|
|
|
suroor_bio wrote:
it is a phonebook program in console application)
Where exactly are you facing problem buddy
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
class Photo
{
std::string sName;
std::string sPhoneNo;
}
class Photos
{
public:
Photos(std::string sFileName)
{
//readFromFile
}
bool SaveToFile(std::string sFileName);
private:
list<photo> lstPhoto;
}
I love Programming
|
|
|
|
|
I want to save the entry details on the hard disk
after entering it
then when I open the programe again I want the details to be entered to the list again
I APPROCIATE ANY HELP
#include
#include <list.h>typedef CList<phonebookentry *,="" phonebookentry="" *="">
PhoneBook;
struct PhoneBookEntry
{
CString Name,phone;
};
//***********************main************
switch (nChoice)
{
case 1: // add entry
PhoneBookEntry *pEntry;
pEntry = InputEntry();
g_PhoneBook.AddTail(pEntry);
break;
case 2: //list entries
pos = g_PhoneBook.GetHeadPosition();
while (pos)
{
PhoneBookEntry* pEntry = g_PhoneBook.GetNext(pos);
PrintEntry(pEntry);
}
}
//***********************************
PhoneBookEntry* InputEntry() //func. to enter details
{
PhoneBookEntry* pEntry = new PhoneBookEntry;
cout << "Enter new entry details:" << endl;
cout << " Name: ";
char cName[100];
gets(cName);
cout << " Phone: ";
char cOfPhone[100];
gets(cOfPhone);
pEntry->Name = cName;
pEntry->Phone = cOfPhone;
return pEntry;
}
//**********************************************
|
|
|
|
|
I am using the function inside a custom modal dialog. The arguments I pass are :the dialog’s window handle and the pointer to the object of a class in which I have implemented the IsecurityInformation interface with 2 additional functions of mine.
The application runs fine but crashes sometimes. The crash can be reproduced even when I just move the permission dialog. I think there is some problem in the implementation of the interface. I have tried with passing NULL as first argument but it crashes everytime.
The crash occurs in the Defwindowproc function
Sudhir Mangla
http://Programmerworld.net
(Free books , articles , Source Code and Programming Tools and Utilities)
|
|
|
|
|
I'm using windbg to debug an instance of iexplore.exe. In my test case, iexplore.exe loads a file a.htm (hello world).
Basically I want to step into the iexplore dissassembly the moment it loads a.htm into memory ..i.e before a.htm gets rendered... How do I do it? Help needed please.
|
|
|
|
|
|
Hi,
I hav got an MDI application and a modal child dialog. Now i call this dialog using DoModal(). when i toggle 'CAPS Lock' key ,the ID_INDICATOR_CAPS in Mdi's Statusbar is not updated .
Can any one help me ...?
Thanks,
Abin
|
|
|
|
|
Hi,
When u use domodal to display ur dialog, the focus will be only on the dialog and not on the parent window. Unless u close the dialog, the parent window cannot process any message. Try to use modeless dialog if u want ur parent window to process messages even when the dialog is displayed. Refer MSDN for more details.
Adios,
Ju
|
|
|
|
|
Can anyone suggest a way of detecting whether a CD or DVD is present in a drive without trying to access that drive?
|
|
|
|
|
The only way to see if someone is home, is by knocking on the door...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Or by setting the house on fire and see if someone gets out screaming... But ok, that may not be the most elegant solution
|
|
|
|
|
Yeah, but after you see that someone is home, they'll be gone afterwards..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|