|
|
1. I have one Access .mdb file. How to read the names of the tables in it, using ADO
2. In the same database, how to read the description field of each column, using ADO again
Any answer will be helpfull. Thanx in advance!!!
|
|
|
|
|
Dir,
I write a VC++ program, and want delete a folder use code below:
RemoveAllDirectory(LPCTSTR pstr)
{
SHFILEOPSTRUCT sh;
TCHAR from[100];
lstrcpy(from, pstr);
lstrcat(from, "\0");
sh.hwnd = GetSafeHwnd();
sh.wFunc = FO_DELETE;
sh.pFrom = from;
sh.pTo = NULL;
sh.fFlags = FOF_NOCONFIRMATION | FOF_SILENT;
sh.hNameMappings = 0;
sh.lpszProgressTitle = NULL;
SHFileOperation (&sh);
}
But when I want delete folder like: "C:\\Progra~1\Netscape\\user\\someone\\cache\0" it generate a dialog error: "Can not delete file: File system error (1026)"
Please try and help me!
Thank you!
HuuQuynh
|
|
|
|
|
Put this line after your declaration [SHFILEOPSTRUCT sh;]
ZeroMemory(&sh, sizeof(SHFILEOPSTRUCT));
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Dir Nish,
I don't think so! But I try your code, the same error!
any ideas?
Thank you any way
|
|
|
|
|
I just tried the following out on my machine without any problems
LPCSTR buff="C:\\New Folder\\New Folder\\aaa";
SHFILEOPSTRUCT shfop;
ZeroMemory(&shfop, sizeof(SHFILEOPSTRUCT));
shfop.wFunc=FO_DELETE;
shfop.pFrom=buff;
SHFileOperation(&shfop);
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hi,
all
Who can tell me how can I get the resource ID of the
current Cursor in my application.
Regards.
|
|
|
|
|
GetCursor() will return the handle to the current cursor.
That should do, huh?
Why do you want the resource id?
Anyway, try using MAKEINTRESOURCE on the HCURSOR. I don't know if it will work. An HCURSOR is basically a HANDLE which is actually a void*. A void* is actually 32 bits.Thus an HCURSOR is a 32 bit number. MAKEINTRESOURCE takes a WORD as parameter and a WORD is only 16 bits. So initially I thought this would be a problem. But MAKEINTRESOURCE is defined as shown below :-
#define MAKEINTRESOURCE(i) (LPTSTR) ((DWORD) ((WORD) (i)))
As you can see the first cast is to a DWORD.
So I hope it will be okay.
But then, I might be wrong.
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
I wouldn't use MAKEINTRESOURCE, guys. Whilst a HCURSOR is a void *, that's not what MAKEINTRESOURCE is for. The resource management functions in Win32 take in an LPTSTR (a string). This string is the resource "name". The documentation for Win32 shows that this LPTSTR can be an actual pointer to a string name for the resource ("My New Resource"), OR, if the value of the LPTSTR only uses the lower 16 bits (ie it's a DWORD) the value represents the resource ID (IDR_MY_NEW_RESOURCE = 16000).
So, after all that the basic answer is, I don't think you can determine the resource ID from the current cursor (after all, it might be created from a resource located in a DLL, another EXE, or the system somewhere).
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
All Gurus:
How to convert ADO Recordset to .txt file by XML or others methods?
thanks in advance!
|
|
|
|
|
Iterate through the Recordset and keep writing into a flat file. You may write it as XML or as CSV.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hi:
thanks Nish, How Can I convert xml or csv to flat file
|
|
|
|
|
By flat file I meant a file containing records having no structured inter-relationship. Means you can't query them using SQL-like syntax. You'd need to read the records sequentially or using an index.
The advantage with an XML file is that you can use XML parsers like Expat or MSXML parser.
The advantage with a csv file is the ability to convert it into excel. I think MS has ODBC drivers for CSV files.
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Thanks Nish,By your help, I have solved the problem.
|
|
|
|
|
Hi, I have a question
Ive seen programs where a user has a program open like MSN which has edit controls. Another program that isnt made by the same people as MSN is open and it can be used to fill in edit controls like the text field and send messages etc....
How would I do this?
Thanks
Ashman
|
|
|
|
|
I am not sure I understand you correctly. But if you want to send data across applications you can use WM_COPYDATA
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
In my project I've got a RichEdit box, with a mapped member variable t_Display. I've created a thread that waits for some input (in this case from a socket) and then tries to add this data to the RichEdit box. I am getting an assert error and I have no idea why. Could anyone help me? The code I'm using is thus:
char msg[MAXMSGLEN];
while (fConnected) {
sock.Recv(msg, MAXMSGLEN);
UpdateData(true);
t_Display.Format("%s%s\r\n", (LPCSTR)t_Display, msg);
UpdateData(false);
}
- X
'Reality is the only obstacle to happiness'
|
|
|
|
|
I assume the UpdateData() call is asserting. You can't pass or access CWnd objects between threads. You'll need to use API-level code to update the edit control from your secondary thread.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
How can i open a dialog for browsing a directory
( not a file) ???
|
|
|
|
|
Use SHBrowseForFolder() . This article goes into more details.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a checkbox, and i want to change it's backgorund color. How do i do that?
|
|
|
|
|
This question appears so frequently that IMHO should be included in the FAQ.
Check Yuri Goltsam's article Colored/Blinking Controls and Dialogs with any Font for a particularly elegant solution.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi !
I'm developping a small SDI app with a CRicheditCtrlView.
a few questions :
1. How can I know that the embedded CRichEditCtrl is scrolling ?
I can handle clicks on scroll bars with VK_VSCROLL, handle page up /page down keys ....
Is there a way to detect scrolling without coding a method for each message ?
2. How can I calculate the number of text lines being deisplayed ?
Is there an equivalent for GetFirstVisibleLine() to find the last visible line ? If not, does someone know a method to achieve this ?
Thx
|
|
|
|
|
"1. I can handle clicks on scroll bars with VK_VSCROLL, handle page up /page down keys ....
Is there a way to detect scrolling without coding a method for each message ?"
Override OnHScroll and OnVScroll, these methods are called whenever horizontal or vertical scrolling happens.
"2. How can I calculate the number of text lines being deisplayed ?
Is there an equivalent for GetFirstVisibleLine() to find the last visible line ? If not, does someone know a method to achieve this ?"
I think you have to use GetFirstVisibleLine and then start adding line heights until you get to the window size and declare that your "last visisble line"
Hope this helps,
Bill
|
|
|
|
|
A while back I had been working on a mp3 player/organizer that used the XAudio engine for playback. I haven't touched it in a while and just recently I wanted to pick it back up, but the xaudio web site has been saying that they are down updating their site. I have been watching it for over a month and either they are very slow at updating or it may not be available for good. Does anyone know where I can download the XAudio SDK(I hope) or does anyone recommend a different solution.
Joshua
Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|