|
First off you'll need to call DragAcceptFiles() . Then you'll need to handle the WM_DROPFILES message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I wrote an application using Visual C++ which uses a database written in Access. I access this database through ADO. It seems this application works fine under XP, 2000 and ME, however I have been told be people using this application under 98SE and NT they are having database issues. So far the database issues are SQL queries that have incorrect syntax, for example "SELECT FROM ORDER Description as" where the correct syntax should be "SELECT * FROM ORDER BY Description asc". I'm not sure why this is happening. Is it possible that NT and 98 might need an additional library so it understands ado? Is ADO compatible in 98 and NT? Do I have to access the database differently for 98 and NT?
Thanks!
|
|
|
|
|
i don`t get it, what happened?
brchris wrote:
for example "SELECT FROM ORDER Description as" where the correct syntax should be "SELECT * FROM ORDER BY Description asc".
Did your app build the wrong query?
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
it must have. I built the error screen that comes up, and I double checked with the guy who received the error screen to make sure that query string was 100% correct as he sees it. So according to him, my app is building wrong query strings on NT. Very bizarre.
|
|
|
|
|
How do you build the string. I had this kind of problem long ago.
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
I build it using the following psuedo code
CString SQL;
SQL.Format("SELECT <fields> FROM where ...");
open table using ADO class.
In a sense I am building them using the CString method and the Format method for pretty much all of my SQL queries.
Thanks!
|
|
|
|
|
Why do you use Format?
My query was:
CString query;
query="SELECT FROM table there var1='";
query+=var; //var is a variable
query+="'";
I think you should debug it. Hope this helps
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
Format seems like an easier way to accomplish the same task you wrote above. It's possible Format could be causing it but why would it remove hard coded values? The string in question is code like this
SQL.Format("SELECT * FROM AG_ERAS ORDER BY Description");
Albiet, it would be interesting to see what this does if I coded it
SQL = "SELECT * FROM AG_ERAS ORDER BY Description;
but that seems odd. Both do exactly the same thing. Unless NT has problems with CString.Format.
I will test the theory though.
Thanks!
|
|
|
|
|
brchris wrote:
SQL = "SELECT * FROM AG_ERAS ORDER BY Description;
Don`t forget with the closing
SQL = "SELECT * FROM AG_ERAS ORDER BY Description";
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
Changing the SQL.Format(...) to SQL = "..."; had no effect.
|
|
|
|
|
Have you try to debug it. What is the query when you debug it. Can I see the code? Maybe I can help
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
how to convert the password in c++ to ****** when u write the password it change to ******
|
|
|
|
|
Assuming you are using standard console functions, write your own version of "gets" that reads in standard character input, but prints only the character '*'.
|
|
|
|
|
Are you typing into an edit control? If so, just use the ES_PASSWORD style.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Whenever I start MSDN Library January 2000 It says: "cant open the file msdn000.col". How can I solve this?I am using WİnXP Pro. Pleasee Help, its urgent!!
B.R.K@4000
|
|
|
|
|
I have the exact same problem with my MSDN library. I cannot fathom what the problem is. The file itself seems to just be an XML file containing links to the .chm files in a tree structure.
To solve my problem I create a seperate .col file and write the contents of the initial file to that. Then I modify the MSDN registry settings and the links in the start-menu etc. to point to the new .col file.
It is a strange thing, and Microsoft don't seem to have offered a fix for it.
See if that works...
|
|
|
|
|
I found this in the Microsoft site "http://support.microsoft.com/default.aspx?scid=kbN-US;195878" But I dont understand how to solve,I didnt find the .dat file in windows\Help directory.Can u send me the msdn000.col file please?
B.R.K@4000
|
|
|
|
|
i have this problem which is the magic square. i need to know how to use the keyboards arrows in the program like he says. and i only can put number "1" and "2" in their right place can't get the equations for other numbers.
the prompt is:
A magic square is an n*n matrix in which each of the integers 1,2,3…n^2 appears exactly once and all column sums, row sums, and diagonal sums are equal. For example, the following is a 5*5 magic square in which all rows, columns and diagonals add upto 65. The magic number can be calculated according to the following equation : Magic = Sum (1..n^2)/n.
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
The following is a procedure for constructing an n*n magic square for any odd integer n. Place 1 in the middle of the top row. Then after integer k has been placed, move up one row and one column to the right to place the next integer k+1, unless one of the following occurs:
• If a move takes you above the top row in the jth column, move to the bottom of the jth column and place k+1 there
• If a move takes you outside to the right of the square in the ith row, place k+1 in the ith row at the left side
• If a move takes you to an already filled square or if you move out of the square at the upper right-hand corner, place k+1 immediately below k.
Write a program to construct n*n magic square for any odd value of n. Your program should provide the facility for the user to input the numbers in any desired position (given it is free). Your program should check the user’s input to verify that it results into a magic square. If this condition is valid you congratulate the user, otherwise you generate the right answer for the user. The user is allowed to play the game as many times as he/she wants, when the user chooses to end the puzzle, your program should tell him his score (number of times he managed to solve the puzzle/number of games).
Input
Max dimensions of the array
The user will then play the game by placing numbers from 1..n^2 on the board
Output
Solution of the puzzle in each time the user chooses to play
User’s percentage
|
|
|
|
|
|
Hello
I am coding an application I do have problem to work with ActiveX COM. I do not know how to convert
System::String * form structure or char and pass to function with argument which is type of System::Object _gc * _gc *.
Does anybody can help???
Tnx
Mirdous
|
|
|
|
|
Hello,
I am new to Mulithreading. In my project I am working with multiple threads. Since I haven’t worked with threads before, I am facing many hurdles. Can any one please guide me or give some hints.
I am explaining in brief about the threads used by me in my project.
1st thread: Filter Thread
Is started at application start up.
Filters each line read from file( Log data is read from file)
I have used CCriticalSection and CSingleLock to lock the data access here as this
LIST is accessed in Display thread.
Adds the data to the LIST from top.
This thread has to run continuously till the application end.
2nd thread:Display Thread
Is started at application start up.
Displays each line filtered by Filter thread
I have used CCriticalSection and CSingleLock to lock the data access here as this
LIST is accessed in Filter thread.
Retrieves the data from the LIST from bottom.
Deletes the data from the list after display.
This thread has to run continuously till the application end.
3rd Thread: Monitor Thread
Is started at application start up.
This thread has to continuously check if new records are added to the file ( Here another external application will add records to the file)
If new records are added, it notifies the Filter Thread, which fetches the added records, filters them and gives to Display thread for displaying.
Since all the above three threads have to run continuously, I had used sleep in all the threads as shown below.
UINT ThreadFunction(LPVOID lp)
{
while(TRUE)
{
// Do the work
}
}
The result of this is that CPU time is 100% used because of the While loop.
Can anyone please suggest an alternative for while loop in the other two threads.
Thanks
Madhavi
Madhavi.
|
|
|
|
|
Try to replace Sleep with WaitForSingleObject .
UINT ThreadFunction(LPVOID lp)
{
m_eventShutdown.CreateEvent();
while(TRUE)
{
DWORD dwRet = WaitForSingleObject(m_eventShutdown.m_hObject,1);
if(dwRet==WAIT_TIMEOUT)
else if(dwRet==WAIT_OBJECT_0)
else
}
}
|
|
|
|
|
Hi,
Thanks for the inputs.
I have a doubt here. If I use WiatForSingleObject inside my While loop , won't that eat my CPU time because While loop is still present?
Madhavi.
|
|
|
|
|
If you set the timeout not equal 0 in WaitForSingleObject , each time your thread calls WaitForSingleObject it passes the control to the system scheduler and it won't eat 100% of your CPU time (it is similar to "pumping messages" in UI threads).
|
|
|
|
|
Hi Andrzej Markowski,
Thanks for your inputs.
I have declared my monitor event as below first.
volatile HANDLE m_MonitorEvent;
m_MonitorEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
ResetEvent(m_MonitorEvent);
//This event is set in the part of code which triggers this event.
SetEvent(m_MonitorEvent);
//Thread function
BOOL b_EventRunning = TRUE;
UINT ThreadProc(LPVOID lpVoid)
{
while(b_EventRunning == TRUE)
{
DWORD dwWaitResult = WaitForSingleObject(m_MonitorEvent, INFINITE);
switch (dwWaitResult)
{
case WAIT_OBJECT_0:
//Do the work
ResetEvent(m_MonitorEvent);
break;
default:
Sleep(1);
break;
}
}//end of while
}//end of ThraedProc
I used INFINITE in WaitForSingleObject because my this thraed has to run till the application is exited.
When this thread is doing the job, the CPU usage is shown as 100%. Please let me know if I'm missing out something here which is making my CPU consume 100%?
Thanks
Madhavi
|
|
|
|