|
S. Becker wrote: ...it compresses the database by calling SQLConfigDataSource API function.
How are you calling it?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
CString sDriver = _T("Microsoft Access Driver (*.mdb)");
CString sAttributes = _T("COMPACT_DB=") + m_sTargetDB + _T(" ") + m_sTargetDB + _T(" General");
int retcode = ::SQLConfigDataSource(AfxGetMainWnd()->m_hWnd, ODBC_ADD_DSN, sDriver, sAttributes);
Regards
Sascha
|
|
|
|
|
This looks okay. When the compacting is done, can you add the Users group back to the file's ACL?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I never had to implement security functions before and it looked very difficult. This morning i was very happy to find a mail of a colleague that showed me where to find a function in our source base that exactly does that. My problem is solved.
Thanks you for your help.
Regards
Sascha
modified on Tuesday, February 12, 2008 5:12 AM
|
|
|
|
|
Hi all
I have created a file and passing some arguments through console application.Now when i open the file to read or write...no other must able to read or write into it...which is better concept shall i use....
thanks in advance..
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
|
|
|
|
|
Does this help?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Pardon?
You have created a program, and want it to only be run once at a time?
This is a little bit hard, but there are plenty of examples on codeproject. Just search for "singleton", or "run once"...
You have created a program, and it opens a file, and that file should not be openable by anybody else?
That;s the default - but don't take my word for it: look at the documentation for CreateFile, and the sharing flags like (eg) SHARE_DENY_WRITE etc.
------
Hi,
I am Iain, and I have not completed my Degree in psychic post-reading.
But I do realise that my sig is not the place for my CV - I have an about-me section on my member profil which anyone can see by clicking on my name.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
sharanu wrote: which is better concept shall i use....
It all depends on how you are opening the file. In general, you want to open the file exclusively, or deny others read|write access.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i am trying to insert text into notepad.
CWnd *myWnd = FindWindow(_T("Notepad"), _T("Untitled - Notepad"));
if(myWnd)
{
::PostMessage(myWnd->GetSafeHwnd(),WM_CHAR,(BYTE)'a',0x000e0001);
} if i enable the second line, notepad is quitting. how to insert a character? it is not working.
|
|
|
|
|
http://dictionary.reference.com/browse/destroy[^]
Destroy:
1. to reduce (an object) to useless fragments, a useless form, or remains, as by rending, burning, or dissolving; injure beyond repair or renewal; demolish; ruin; annihilate.
You're getting the main window for notepad.exe - so it shouldn't come as a great shock that if you send a DESTROY! message, it closes. What did you expect?
Even if you actually had the text area for notepad, why on earth would you think WM_DESTROY would help you put a character there? I hope I'm missing out on something in your question that you didn't write down.
Your idea of sending a WM_CHAR isn't bad - but you're sending it to the main window for the application. If I use Spy++ on notepad, there are two child windows - a big edit one, and a status bar window. You could get the child window, and try sending the WM_CHAR to that. But that is implementation dependent. For all I know, notepad.exe under Vista is built completely differently. Maybe it uses a richedit window, rather than an edit one? Or Notepad under windows 2000 didn't have subwindows, it just worked as you expected.
I would have a look at WM_PASTE message. It's likely the notepad's parent window would pass it on to the child edit window to handle, and that would paste the contents of the clipboard into notepad. It is harder to set up some text on the clipboard - but there are samples on codeproject - and it would allow you to do more than one letter at a time.
I hope that helps,
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Iain Clarke wrote: Iain Clarke appearing in spite of being begged not to by CPallini.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I was wondering when you'd spot that... I'm going to have to change it now!
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
can u please tell me how to get the handle of notepad's edit window/
|
|
|
|
|
What about EnumChildWindows [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Iain Clarke wrote: I hope I'm missing out on something in your question that you didn't write down.
i mean the destroy msg is working and the wm keydown msg was not working. destroy is commented. paste is not working. any other alternative? thanks for the reply.
|
|
|
|
|
Aljechin wrote: i mean the destroy msg is working
WM_DESTROY is a notification message from the system.
Sending it to a window that actually isn't being destroyed
isn't going to do anything except possibly leave the target
application in an unstable state.
What are you expecting sending that message to do?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm not an expert on such operations but
do you have tried it already with a WM_KEY_DOWN?
|
|
|
|
|
baerten wrote: WM_KEY_DOWN
Uhmmm, are you sure the notepad is aware of such a message?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
a plain dump solution, activate the notepad application and generate keyboard event
(keybd_event() API)
modified on Thursday, February 07, 2008 6:54:00 AM
|
|
|
|
|
Hi to all.
I imported some files to resource (under ResourceView tab VC6). Main reason for this is so I don't need to distribute those files with application. In some time I need to load this files from resources and FTP transfer them away... How can I load them to say temp file?
Thanks in advance to all!
|
|
|
|
|
You can use FindResource to get an HRSRC handle to your resource.
Then SizeofResource to get it's size, and LoadResource / LockResource to get a handle on it.
Using that information, you can save the binary data to a temp file, then do whatever you like with it - including using APIs to FTP it somewhere.
Searching for those functions will give you their parameters.
Lastly, if you're using MFC, you may need AfxFindResourceHandle (?) to get the HINSTANCE the resource lives in in your app / dlls.
Good luck,
Iain.
Iain Clarke appearing regardless of CPallini.
|
|
|
|
|
Thanks you very much. I'll try to do so now!
|
|
|
|
|
Now when I loaded resource how I can save it to a file?
I created temp file but what api saves my loaded resource to a file?
THX
|
|
|
|
|
Using LockResource (as I said in my previous post), you can get a void pointer to the data (read only!), and using SizeofResource you get the amount of data.
So, you just need to save this lump of data to a file using WriteFile... Just as you would save any other lumps of data.
Have a look at GetTempFileName to get the filename for a throwaway file,
CreateFile to create it (oddly enough)
and WriteFile to save data into it.
If you look at the documentation for those, you should be good to go.
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
hi...
how can i store images to sql database?
how can i retreive image from sql database?
please help me. am trying this for last few days...
but still i didn't get...
thank you...
paulraj
|
|
|
|