|
Sounds like a problem I had with 2000, there is a known issue.
Before you open the file add these two lines.
// These lines are required to access Access 2000 databases
AfxGetModuleState()->m_dwVersion = 0x0601;
AfxDaoInit();
If you search the MSDN site you will find the explaination.
http://support.microsoft.com/support/kb/articles/Q236/9/91.ASP
and
http://msdn.microsoft.com/library/periodic/period00/c++0100.htm
I added the above lines and it allows me to read both 97 and 2000 files.
I have not done much testing though.
|
|
|
|
|
Hi,
My application while starting is placed in the systray as a icon. When i double click the icon, i get a Dialog. If i execute my application again, i get one more icon in the systray and similarly if i double click the icon twice two dialogs appear on the screen. I want to have only one icon on the systray and even if i click the icon again ( ie double click ) it should show only the previous dialog and not the new one.
ie I want to have only one instance of my application at any time.
Can anybody help me in doing this.
Thanks in advance
VMJ
|
|
|
|
|
Hello,
In first line of InitInstance method of the Your application class, put the following code,
APP_NAME -- is the DialogWindow Title.
if(AfxGetMainWnd( )->FindWindow(NULL, APP_NAME))
{
AfxMessageBox("Application Already running");
exit(0);
}
If any suggesstions let me know.
Thanks ,
- Kannan.A.;)
|
|
|
|
|
Hello,
it works fine, but if you have open another window with the same name (e.g. explorer window or application with the same name) your application won't start.
Better way is to create some kernel object (MS suggest mutex) when your application starts and destroy at ending. Before creating you simply try to open such object and if succeded it means that your application is already running.
Regards
Bartek
|
|
|
|
|
I've created a class that's not an MFC one, its a graph that need to be refreshed in a concrete time lapse.
I would like to use a timer in that class, but I don't know how to do it:
SetTimer(...) asks for a window parameter or for a pointer to a function... Here is where I don't know how to continue.<
Could you give me some advice or help?
a little example would be great.
Thank you in advance.
|
|
|
|
|
If your graph class is derrived not from CWnd (thus not wrapping Windows window object - identified by HWND) you could call SetTimer(NULL, nIdEvent, uElapse, fnTimer), where fnTimer is a method from your graph class. What is important that you should declare this method as static (at compilation time you use its physical address - so compiler should know it ).
Regards
Bartek
|
|
|
|
|
This still won't work if you don't have a window. Timers require a message pump and window to operate, even the callback method.
More likely, what he wants is a either a waitable timer, or simply to use the Sleep function to wait a specific amount of time.
|
|
|
|
|
Yep - it's my fault ...
Hope Sleep() helps.
Regards
Bartek
|
|
|
|
|
Does anyone know of or have any similar code to creating a ticker of a song name or some string using iamages from a bitmap as your text.
Joshua
|
|
|
|
|
Hej Joshua.
This code is quite simple. All you have to do is prepare picture image (in resource editor) and write a procedure which will take a string as a parameter, traverse this string, compute offset of image corresponding to each letter and blit it. Simple, eh?
It remainds me old times - low level assembler procedures, demos, scrollers, vectors, amigas
Regards
Bartek
|
|
|
|
|
|
Suppose that you know make sounds, use this to manipulate the time:
The time in seconds is the value returned by the clock function, divided by CLOCKS_PER_SEC. CLK_TCK is equivalent, but considered obsolete.
#include <time.h>
#include <conio.h>
clock_t start, end;
void time_start()
{
start = clock();
}
int time_trans()
{
end = clock();
return((double)((end - start) / CLOCKS_PER_SEC) );
}
|
|
|
|
|
Hello,
I have a Cable/Dsl Linksys Router and was wondering how I could get the IP address it is using with the Internet provider. I know I can get it manually from the configuration but was wondering how it could be obtained programmatically.
Any thoughts will be appreciated.
Thanks,
Todd
|
|
|
|
|
This one goes out the ATL Wizards out there.
I need to wrap a MFC Window Class control inside an ATL Control.
I know I can subclass, I need to what the best method is.
Has any body done this kind of thing before, eg. Wrapping an Stingray GridWnd for instance
|
|
|
|
|
I am dealing list view ctr in dialog box, all is right i.e no error or warnig is ther but when I run the programm it gives "Unhandeled exception" message.
|
|
|
|
|
Hi Ali,
your description is too short to answer you. Your code is compiling correctly, but you have errors at run time (as I understood). One is certain - you are doing something wrong, but I can't help you Provide some more info ...
Regards
Bartek
|
|
|
|
|
Hello all.
I'am designing some application and I wish that end user could send an e-mail with some attachement by simple pressing button. I want to avoid him of being confused by configuring any connections.
I assume that user's machine has already configurated Internet connection (in most cases Dial-Up with modem) and E-mail client installed (in most cases MS Outlook).
So I see it working in this way: user clicks on a button and this action runs E-mail client - sets the recipient, message and attachement. User only has to press the Submit button (from e-mail client) (or even without - e-mail is sending automatically). The client optionally calls the Dial-Up connection to set up the connection.
I tried opening url ("mailto:xxx@yyy?subject=zzz"), but I cant figure how to set attachement and message body in this manner. So I looked into MAPI specyfication and implemented some sample. But there is a problem: after Submit action, even I have Lotus Notes and MS Outlook installed (LN is default client) I always see an screen to set up the profile. Bleee - this is the less expected thing I wanted to see ...
I dont know the MS Exchange technology well. Any help will by appreciated.
Similiar mechanism works fine in WinZip.
And sorry for my not always briliant english
Best regards
|
|
|
|
|
if you wolud like i could send you a MAPI class for you to handle e-mail sending (recieving)
through vc++
|
|
|
|
|
You HAVE to set up the client machine (configure an e-mail profile) at least once before you can use MAPI to send e-mail. Actually, before doing that, you HAVE to add the an e-mail account for this client to the exchange server that is processing the e-mails. If you have done the above, the rest (sending e-mail from a program) is easy. I have sample code (a simple ActiveX control) if you are interested.
|
|
|
|
|
Hello again
After receiving some answers (thank you very much!) I want to slightly modify the question: Is anybody know how to send e-mail programatically (with attachement and message) without using MAPI (like WinZip menu-context: 'Zip and Email sth.zip')?
Becase potential end-users are rather rookies than professionals I don't want to get them confused by configuring profiles with Exchange server. Is there any way to get an advantage of Ms Outlook or Lotus Notes installed and configured? As I know those apps don't use Exchandge profiles and vice versa.
Best regards and smile
|
|
|
|
|
I haven't used this myself, but it looks like this may be what you want:
http://www.codeproject.com/internet/csmtpconn.asp
|
|
|
|
|
OK - it's fine. But as I said before - there is a need to specify SMTP server - beginner users not always know it. And then I should call Dial-Up connection where MS Outlook does it all for me.
Regards
Bartek
|
|
|
|
|
As said before, there are two ways: MAPI or POP3/SMTP. Using MAPI you take advantage of your email application installed on the same computer, assuming that email application handles MAPI (most do). All you have to do is select that application as MAPI application, this is done in the application's preferences (Outlook/Netscape etc).
There are some classes on CodeTools for simplifying the MAPI job, but VC++ 6.0 docs contains a good guide also. Sending email is a LOT easier than receiveing and I'd guess that WinZip uses MAPI to send it's email.
|
|
|
|
|
try using pj naughter's pop3 and smtp classes
they work real good (if you use unicode you'll have to make a couple of mods)
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Why Not send a link ??
There are security concerns to consider when sending attachments,
But Links become the users resposibility !
Regardz
Colin Davies
redo C++ , Coder
|
|
|
|