|
Hello all
I have an information on a hard disk with unknown format which the windows cannot recognize it. and it is very urgent now for me to make a backup. so I am asking for a very low level tool to make a backup for my drives.
|
|
|
|
|
try this
http://www.freedownloadscenter.com/Best/hex-disk-editor.html
|
|
|
|
|
Hi,
I have a C#.net application in which i have read the datas from excel sheet and displayed in a datagrid in my Aspx form.
The code is here
private void Button2_Click(object sender, System.EventArgs e)
{
try
{
string strConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Salary.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
OleDbConnection conn = new OleDbConnection(strConnection);
//conn.Open();
OleDbCommand command = new OleDbCommand("SELECT * FROM [Sheet1$]", conn);
// command.Connection = conn;
// command.CommandType = CommandType.Text;
// command.CommandText = "SELECT * FROM [Sheet1]";
OleDbDataAdapter da = new OleDbDataAdapter(command);
DataSet ds = new DataSet();
//DataTable dt = new DataTable();
conn.Open();
da.Fill(ds, "EmpSal");
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
//da.Fill(dt);
conn.Close();
lblError.Text="The Excel sheet has been read";
//return dt;
}
catch (Exception ex)
{
Response.Write( ex.Message);
//return null;
}
}
the thing is that i have to upload the datas into the mysql database table. can anybody pls help me with the C#.net code. i need to use only mysql database.(coz we r using mysql db in our project)
Regards
Vijay.
|
|
|
|
|
Posting a C# .NET question in the Visual C++ forum will end in tears. - Chris Maunder
Anything I will say you will bring it down to whatever you want.
|
|
|
|
|
Sorry chris, i didn't intentionally do it. i was in a puzzly mood at the time of posting this question and it ended up mismatched. once again I apologize for my mistake.
Vijay.
|
|
|
|
|
Dear friends,
I am new to vc++. I am writing an application that executes a dos command which generates some files. I can user CreateProcess methid to call the dos command. But I want to exit the function only after the completion of dos command. Is it possible? I heared that I can use WaitForSingleObject. Could any body teach me how to write this?
thanks
|
|
|
|
|
Something like this...
PROCESS_INFORMATION ProcessInformation;
if (::CreateProcess(..., &ProcessInformation))
{
::WaitForSingleObject(ProcessInformation.hProcess, INFINITE);
::CloseHandle(ProcessInformation.hProcess);
::CloseHandle(ProcessInformation.hThread);
}
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I want to store a bunch of MD5 strings computed from username/password. Have any storage class to facilitate this?
Thanks
|
|
|
|
|
whats wrong with std::vector<std::string> ?
it really depends on what you wish to do with the results
'g'
|
|
|
|
|
I have a CDialog derived class (CColorSliderDlg) that has three scroll bars on it.
CColorSliderDlg doesn't have a border and so uses the SetCapture to detect when the mouse has been clicked outside it.
Because I'm using SetCapture the child controls will not get any mouse messages. So in the PreTranslateMessage I check if the message should go to a child and forward it to it.
BOOL CColorSliderDlg::PreTranslateMessage(MSG* pMsg)
{
POINT pnt = pMsg->pt;
ScreenToClient(&pnt);
CWnd *child = ChildWindowFromPoint(pnt,CWP_SKIPINVISIBLE);
if (child != 0 )
{
pMsg->hwnd = child->GetSafeHwnd();
}
return CDialog::PreTranslateMessage(pMsg);
}
When the mouse is released for the slider I set the capture back.
void CColorSliderDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if (nSBCode == SB_ENDSCROLL)
SetCapture();
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
This works great on the first slider on the dialog.
When I added the other two only the first one will respond.
If I tab and use the keys or the wheel mouse the slider will move. But click and drag just won't.
If I remove the SetCapture everything works great again but I can't close the dialog.
Thanks
Mark
|
|
|
|
|
mtwombley wrote: This works great on the first slider on the dialog.
When I added the other two only the first one will respond.
According to the docs:
"Only one window at a time can capture the mouse."
mtwombley wrote: CColorSliderDlg doesn't have a border and so uses the SetCapture to detect when the mouse has been clicked outside it.
I'm not sure what you're trying to do. If the mouse moves outside the slider then you'll get
WM_LBUTTONDOWN, WM_MOUSEMOVE, etc. messages at the underlying dialog.
Maybe another solution would be to use TrackMouseEvent() on the sliders to tell the system they
should receive WM_MOUSEHOVER and WM_MOUSELEAVE notifications. Then you don't have to fight the
mouse capture stuff.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark for the reply.
I'm not doing the SetCapture on the slider. I'm doing it on the dialog so it knows when the user clicks outside of it and can then close.
My dialog is based on a Color Picker by Luis Ortega http://www.codeguru.com/cpp/controls/buttonctrl/article.php/c2089/.
Luis showed a grid of buttons for the colors and then had an other button.
For my application I wanted to have three sliders for color selection.
I placed one slider on the dialog and got that working which was great. But as soon as I added the other two they stated to act funny. If SetCapture is on the dialog the first slider is the only one that responds.
Hope this clears up my question.
Thanks
|
|
|
|
|
Thanks for more info!
mtwombley wrote: I'm doing it on the dialog so it knows when the user clicks outside of it and can then close.
Maybe this works but here's another line from the docs:
"SetCapture captures mouse input either when the mouse is over the capturing window, or when the
mouse button was pressed while the mouse was over the capturing window and the button is still
down."
I would think when you drag a slider, the slider control is going to capture the mouse so the
dialog will lose the capture anyway.
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Actually that does happen.
But only on the first slider on the dialog. For some reason the other sliders will not accept the first message. I say the first because if you click it twice then it starts working.
Mark
|
|
|
|
|
I tested your code.
I can't move any trackbars until I click on the cancel button but drag the cursor off it before
releasing - that releases capture from the dialog. Then I can drag a trackbar thumb.
I think the PreTranslateMessage() needs to really only pass certain mouse messages to the child
under the cursor, not all messages. I would guess that WM_SETFOCUS and WM_PAINT, at the very
least, are going to be a problem in the current implementation.
I'm still playing with it but I'm about to be interrupted for dinner.
I shall return.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark for looking into this. I was just trying to build on some existing code not realizing I would have so much trouble.
I've got a deadline I need to meet so I'm just going to put a tool window on the dialog and the user can close it when they are done.
Later I might come back to this or just create a CWnd that contains the sliders and don't use the DoModel().
So many ways too do something.
Thanks again
Mark
|
|
|
|
|
Oh it's modal too? I was testing modeless
There should be an easier alternative with a modeless dialog. You can use focus or activate
messages to close the dialog when the user leaves it.
Good luck!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I have a dll that runs two functions:
One is to disable the USB porst....
TWO is to change the WinLogon keys: DefaultUserName and DefaultPassword.
These two functions use the LogonUser function that I pass the administrators account. It does not works fine the first time executing like this.
USB
WINLOG AS LIMMITED ACCOUNT
Everytime I try to LogonUser the user after executing the second function it gives me an error: Uknown user name or bad password.
Everytime I do it I use administrator's account.
Any help will be greatly appreciated.
Regards,
Jose
|
|
|
|
|
I have written some code which injects a DLL into another process, in order to add a new menu item into the process's window menu. However, once I inject the DLL into the process, I'm not sure how to find out the window handle of the process which I've injected the DLL into - and this code needs to be executed within the DLL, as I am using SetWindowLongPtr() with GWLP_WNDPROC so that I can monitor the window messages to find out when the menu item has been selected. Also note that this DLL is intended to be injected into all the visible running processes and add the menu item to each process's main window.
Thank you for your help
-- PerspX
|
|
|
|
|
Try something like this...
<br />
VOID SomeClass::EnumerateWindows()<br />
{<br />
EnumWindows(EnumWindowsProc,0);<br />
}<br />
<br />
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)<br />
{<br />
DWORD dwPID = 0;<br />
GetWindowThreadProcessId(hWnd,&dwPID);<br />
}<br />
A window is the 'main' window of a process if it has no Hwnd parent within same PID. But keep in mind... some processes can have multiple 'main' windows (such as Outlook). A more correct term to describe these windows are 'Top level windows'
Good Luck,
-Randor (David Delaune)
|
|
|
|
|
Thanks - it works really well and to find out which process owns the DLL, I just compare the result from GetWindowThreadProcessId() with the PID from GetCurrentProcessId()
--Perspex
|
|
|
|
|
Hello
When i use VS6 to write winsock apps, they run normally, but when i try to debug them, i reach the line that initializes the socket :
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
or whatever
and when i press F10 to step over it, i get a runtime error:
First-chance exception in UdpTest.exe (NTDLL.DLL): 0xC0000008: Invalid Handle.
i tried lots of source codes from lots of sites
i have WinXP Pro SP2
Can anybody help me plz
Thanks in advance
|
|
|
|
|
Have you called WSAStartup() before using any Winsock APIs?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
yes i did
here's the line
if (WSAStartup(MAKEWORD(2,2), &data) != 0) return(0);
|
|
|
|
|
After re-reading your post...does an unhandled exception actually occur or do you just see
the first-chance message in the debug output?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|