|
dude even am aware that i have to use XMLParser to read the XML file and then have to map the tags to the table of MS Access database using ADO, but as i am newbee to vc++ and xml so i was looking for an example code or a tutorial which could help me getting started??? Thanks anyway for the help!
|
|
|
|
|
Dude what i am confused with is, how to open all xml files one by one from a single directory, parse the file and how do i know which element is to be updated to which column of which table(MS-Access Database)??, i am newbee to xml and vc++???, what is surprising to me is that there is no single tutorial or example code for this on internet?? dude if you have done such a programming in past plz post something useful?. It will be a great help...Thanks in Advance!!
|
|
|
|
|
May be this code can help you. You can get all the filenames that reside in a single directory. Now once you have the file names you can read the file parse it and use the data
WIN32_FIND_DATA FindFileData; <br />
HANDLE hHandle; <br />
<br />
int complt=1; <br />
char FileName[100]; <br />
strcpy(FileName,""); <br />
char rpath[]="abc"; <br />
char Path[]="abc"; <br />
SetCurrentDirectory(Path); <br />
hHandle=FindFirstFile("*.*",&FindFileData); <br />
<br />
if(hHandle == INVALID_HANDLE_VALUE) <br />
MessageBox("The Path Could Not Be Found."); <br />
else <br />
{ <br />
while(complt) <br />
{ <br />
strcpy(FileName,Path); <br />
strcat(FileName,FindFileData.cFileName); <br />
CString s=FindFileData .cFileName;<br />
if(s.Find ("txt"))<br />
{<br />
}<br />
complt=FindNextFile(hHandle,&FindFileData); <br />
} <br />
} <br />
FindClose(hHandle); <br />
as far as your specific requirement is concerned it would be hard to tell what you actually want to do and the logic behind that.
To update the table accordingly you will have to search for the CDatabase class and use its functions. This class will be derived from CRecordSet. Check out MSDN for details.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks Anshuman for the speedy response dude, my major concern is how to use MSXML parser and when & where to use ADO??.... do i need to have xml schema or a database schema?? to do the mapping of xml tags to MS Access table columns, or by simply opening each file traversing through it's nodes and looking for corresponding table in the database and updating it will do the job??
|
|
|
|
|
if you have small amount of data you can go for the second option.
Read articles on MSXML for this.
For large and huge data you would need a different approach. Can't help you on this man.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
is there anyone who could help me with this?
|
|
|
|
|
I want to create a transparent RichEdit control, and find many example use follow code in parent dialog class:
HBRUSH CParentDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if((nCtlColor == CTLCOLOR_EDIT) && (pWnd->GetDlgCtrlID()==IDC_MYRICHEDIT))
{
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(RGB(255,0,0));
return HBRUSH(GetStockObject(HOLLOW_BRUSH));
}
}
It does not work in my application. I think maybe because which I create is CRichEditCtrl while those example create CEdit, or maybe because my parent window is CWnd class while those example use CDialog class.
Anyone can tell me what the problem is, and how to fix it? help me create a transparent RichEdit control successfully, thanks a lot.
|
|
|
|
|
Hi,
Have u called AfxInitRichEdit in InitInstance of your application ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Yes, I called the function in InitInstance().
|
|
|
|
|
Hi everyone,
Can anyone tell me how to create a window that sits behind the icons on a desktop, and replaces the current background.
Examples of this feature already being implemented are:
- Nvidia - video on desktop
- My Movie Desktop
What I'd like is that:
(1) My window should sit behind all other windows; and
(2) If possible, sit behind the icons on the desktop, replacing or sitting on top of the current windows background.
A snipet of c++/c# code would be great
Regards,
Glenn
|
|
|
|
|
I have an existing Dialog-based application which currently calls ::WinHelp(...); for all help. I would like to upgrade this app so that it uses HTML Help instead. I read that I have to set the help mode to HTML (call EnableHtmlHelp() in the app's constructor. Unfortunately, I cant seem to get this to work. When I try to compile, I get an error indicating that the function EnableHtmlHelp() is undefined. I cant find any info as to what, if any, headers are missing or library references. Any help would be appreciated.
Thanks.
LA
|
|
|
|
|
|
Here is some help from _Russel_.
Add the macros
ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)<br />
ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)<br />
ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)<br />
ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp) to the Mainframe map
And add to the constructor of the application
EnableHtmlHelp();
Then put the help file in the exe folder.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
hi all!
i have create a CTreeCtrl and set an images -brought from CImageList- to it's itemes (each item has it's different icon). but i can't set an image to the sub itemes (all sub itemes have the same image that index 0 in the ImageList, and i can't specify an icon to sub item.
Who may tell me please how to set an image to the tree sub item?
That's that.
|
|
|
|
|
Hi,
The follow link maybe have some help for you.
http://www.codeproject.com/treectrl/DeviceTree.asp
|
|
|
|
|
|
Hi All,
I had created dll using C#.
I tried to test all the functions using VB.net. The functions are doing what I want them to do.
Now, I want to use it my C++ program. C++ using VS 6.0. Not with C++.Net.
I tried to insert it from COM but that's it. I'm stuck. Dont' know further steps to call those functions from that dll.
May I please know how to use dll that was created by C# in C++ MFC project.
Thank you very much for your time to answer my question.
|
|
|
|
|
.NET dll are refered to as Assemblies and does not act as your convensional dll as you know it. .NET Assemblies are self-describing and contains meta-data that defines the the assembly - this is why .NET assemblies are not registered within the windows registry. The meta-data is why in a .NET application when you add a refrence, theres 2 tabs: .NET Assemblies and COM imports.
OK, your how?
In your C# dll, during design in VS, Edit the AssemblyInfo.cs file. the file contains instruction how to expose your assembly to COM. theres a tag named [assembly: ComVisible(false)] where the default is to not expose classes. set this flag to true.
Piece
PS: You should rather research the .NET assemblies before you use it in your C++ code. There are a few conceptual differences that cannot be said in a paragraph.
|
|
|
|
|
I have written a 6502 assembler/diassembler but here is something that has me stumped. I want the disassembler routine to create a new document in which to place it's output. I use a public function in the App class to call OnFileNew(). The new document is created, but not activated, so the disassembler sends it's output to the document that was active when it was called. When the disassembler exits the new document IS active. In other words: I press the disassemble button, a new child window appears but the output from the disassembler goes into the window under it. When the disassembler exits and I type on the keyboard, the keystrokes go into the new child window, the one I wanted to display the output from the disassembler.
Could anyone out there show me a code fragment that creates a new document and makes it active please?
I program for fun.
|
|
|
|
|
How do you choose which window to write to? or which document/view to write to?
Looks to me that you create the new document/view successfully, but you are still targetting the older (current) document/view... If that's the case, look for how to enumerate documents in the MDI app and then you can direct your output to the write document...
gmileka
|
|
|
|
|
I was wondering if anyone here has ever run across this problem. I have a COM DLL that builds and links properly within the IDE. I can register this DLL manually with regsvr32.exe and it will be fine. If the IDE tries to register it it never returns until I find the process in process manager and kill it.
Any ideas?
test
|
|
|
|
|
Is there any difference in the way that the ide IDE is calling regsvr32 vs. the way that you are calling it?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi David,
No, that's jsut it. The IDE does it as a bost build process invoking the -s flag for silence with no message boxes. I should mention that this COM DLL calls functions from 2 other MFC DLL's that are created in this project.
Dave
test
|
|
|
|
|
So what happens if you remove the -s switch? Does the IDE report anything at that point?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
I got a static text
(OnTimer() fuction)
...
...
m_seconds = m_seconds + 1 ;
m_SsecondsStr.Format("%2d:%2d", (int) m_seconds/60, (int) m_seconds%60);
as an output it give me " 0: 1" ," 0: 2",..." 0:10",..
How i have to type the "%2d:2d" so the output will be
"00:01","00:02",..."00:10" ... ?
|
|
|
|