|
Yep RageInTheMachine is right.
none
|
|
|
|
|
I have recently written a Service that parses a large XML file using MSXML, breaks the xml down in to fragments, and then calls a SQL Server stored procedure to process the xml fragment. As each call to the stored procedure is made memory is leaked. I have not been able to find any information concering this particular problem. It also appears that the MSXML objects are also leaking memory. The code fragment that follows is where the leak occurs. All pointer are SmartPointers and no dynamic allocation occurs in my code. Anybody have any ideas?
IXMLDOMNodeListPtr LogEntries = pXMLDocRoot->childNodes;
IXMLDOMElementPtr LogEntry = NULL;
for( int i = 0; i < LogEntries->length; ++i )
{
LogEntry = LogEntries->item[i];
if(LogEntry->nodeType == NODE_ELEMENT )
{
CString nodeName = (TCHAR*) LogEntry->nodeName;
CString spName;
spName.Format(_T("sp_%s"),nodeName);
CString xml = (TCHAR*)LogEntry->xml;
// execute this data
if (S_OK != m_AdoCmd.Execute_StoredProc(spName, xml))
{
CString errorMsg;
errorMsg.Format("Failed to execute stored procedure %s: error: %s", spName, m_AdoCmd.m_errorStr);
LogErrorMsg("ProcessXML: " + errorMsg);
return false;
}
}
LogEntry.Release();
}
LogEntries->reset();
Butch
|
|
|
|
|
I have to do this for Windows 95/98/Me/200/NT/XP:
I have the ID of a process(obtained with Process32First/Next) and I want to get the full path of the executable hwo started that process. In PROCESSENTRY32 the member szExeFile gives me only the name of the file but not the full path...
Thank you!
Best regards,
radu.
|
|
|
|
|
One solution is EnumProcessModules().
OpenProcess()
EnumProcessModules()
GetModuleFileNameEx()
Kuphryn
|
|
|
|
|
That's what MSDN says:
Windows NT/2000/XP: Included in Windows NT 4.0 and later.
Windows 95/98/Me: Unsupported.
So it's not a solution for 95/98/Me...
|
|
|
|
|
I'm working on a project which will need to read/write xls files(Microsoft Excel documents), hmm... I don't have any idea how xls files are serialized, is there any library for doing this? Oh is there any articles/documentation about this topic? Thanks a lot.
|
|
|
|
|
|
|
Ok im trying to count the characters that i have loaded into a buffer i have set up the following function
void countchars(char *buffer, int *count)
/*Counts the number of characters in the text file */
{
int i,counter;
char cdata;
count['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
do
{
{ for(cdata='A';cdata<='Z';cdata++)
if(buffer[i]==counter[count])
{
count++;
}
i++;
}
}while(buffer[i]!=EOF);
}
I am calling this function using the following code:
countchars(buffer,cdata);
printf("\nDistribution of letters in %s is:",fname);
for (c='A';c<='Z';c++)
{
N=cdata[c]+cdata[tolower(c)];
printf("\n'%c' %4d: ",c,N);
for (i=0;i
|
|
|
|
|
|
Do your own homework, Overfiend.
Member since Wednesday 9th April, 2003
8:32 10 Apr '03
Counting characters in a buffer - Overfiend
Visual C++ (Programming Forums)
6:31 10 Apr '03
Counting characters in a buffer - Overfiend
C# (Programming Forums)
10:42 9 Apr '03
Counting characters from a text file - Overfiend
Visual C++ (Programming Forums)
|
|
|
|
|
Im trying but i need some help!
because i still cant get this to work
|
|
|
|
|
My application creates modeless dialog (in separate thread). The problem is that after creating of window system activates it and will put it foreground. How to create it without setting it active ?
How to restrict this window so that could be activated only by user ?
I tried to do this :
OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized)
{
if (nState == WA_ACTIVE)
if (pWndOther)
::SetActiveWindow(pWndOther->m_hWnd);
}
But pWndOther is always NULL.
Any ideas ?
Thank you
rrrado
|
|
|
|
|
First create the Dialog that you want with the resource editor.
BE CAREFULL YOU MUST REMOVE THE "Visible" style from ("More Styles") in the dialog properties.
OR YOU WILL GET A CRASH.!!
Then you must Create a new Class Inherited from CDialog.
Lets say
CUpdateDialog :: public CDialog
with a resource template.. (the dialog editor);
then Create a variable (Object) of the new class.
Lest say
CUpdateDlg m_UpdateDlg;
then go ....
m_UpdateDlg.Create (IDD_UPDATEDIALOG,this);
// This will actuallly do the trick!
m_UpdateDlg.ShowWindow (SW_SHOWNOACTIVATE);
|
|
|
|
|
Sorry about previews post...
You must also disable the "Desabled" style from "More Styles" in the resource editor and use this
m_UpdateDlg.ShowWindow (SW_SHOWNA);
m_UpdateDlg.ModifyStyle (WS_DISABLED,NULL,0);
instead of
m_UpdateDlg.ShowWindow (SW_SHOWNOACTIVATE);
|
|
|
|
|
Thank you very much !
I also have idea about DISABLED, but i didn't try it, i thought it won't work
BTW your solution works so that it won't steal focus, but anyway will create window in z-order higher than parent window (althought it is created like child of desktop window).
So I improved that to this :
m_dlg.Create(IDD_MANUAL,CWnd::FromHandle(GetDesktopWindow()));
::SetWindowPos(m_dlg.m_hWnd,AfxGetMainWnd()->m_hWnd,0,0,0,0,SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOSIZE|SWP_SHOWWINDOW);
m_dlg.ModifyStyle(WS_DISABLED,0);
thank you again
rrrado
|
|
|
|
|
Hi !
I have a class named CGroup in a standard couple of file .cpp and .h, and I'd like to use a STL vector of CGroup s in a structure.
So I typdef ed it in stdafx.h (as explained in a CP article about using STL ) like that : typedef vector<CGroup> tv_Group . The problem is, the compiler is unable to find the "size" of a CGroup class, since the typedef occurs before the class declaration, and therefore throws an error.
I've also tried
class CGroup;
typedef vector<CGroup> tv_Group; unsuccessfully.
I can remember having seen a post here in the forum recently about exactly the same problem, but I have forgotten the proposed solution (Only to say, there _is_ a way to do it).
Thanks for any help.
~RaGE();
|
|
|
|
|
what compiler error exactly do you get?
group.h must be included before typedef. forward declaration "class CGroup;" is not enough because compiler can't deduce the size of CGroup from it. it works if you have a vector of pointers to CGroup:
class CGroup;
typedef vector<CGroup*> tv_Group;
also, i would put the typedef in group.h instead of stdafx.h
hope this helps
|
|
|
|
|
Hi all,
I've tried to install something from microsoft,
but i got an error saying i need to run Cryptographic Service on my machine.....
any1 can help me???
thanks in advanced,
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
can't you just say what you downloaded??
|
|
|
|
|
Hi,
What could be the possible causes for a dragand drop operation to fail. I've used a COleDataSource Object and Initiated a drag operation with the COleDataSource's DoDragDrop method. I find that it has been returning from the ::DoDragDrop( Win32 API) instead of going into a loop. any help would be greatly appreciated. thanks in advance
Vijay.
|
|
|
|
|
Hello Everybody!
if you know about acd/vcd file system or internal file format or structure.
i also want to know about how to perform i/o in cd.
Please Send your Comments or suggetions.
Thank you!
SK
SK
|
|
|
|
|
I don't know if you have some money to pay for a SDK, but I know that Golden Hawk Tech. offers a C++ SDK to write very much formats. But as I mentioned it's quite expensive .
See http://www.goldenhawk.com/cpp.htm for details.
|
|
|
|
|
Nero also has an SDK. I think it's free.
"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
|
|
|
|
|
jdunlap wrote:
Nero also has an SDK. I think it's free.
Not quite. It needs Nero installed to run so it's not really "free"....
|
|
|
|