|
PJ Arends wrote: I am not a network/dialup person so any hints as to APIs to use would be helpful.
I'm not really familiar with any of this either... just glancing over the Remote Access APIs is a bit intimidating. Might still be worth a look though, especially if you can dig up some sample code.
|
|
|
|
|
PJ Arends wrote: Now all I have to do is figure out how to programatically set up a second connection...I am not a network/dialup person so any hints as to APIs to use would be helpful.
Use:
RASENTRY re = {0};
re.dwSize = sizeof(re);
lstrcpy(re.szAreaCode, ???);
lstrcpy(re.szLocalPhoneNumber, ???);
RasSetEntryProperties(NULL, "Second Connection", &re, sizeof(re), NULL, 0); You might then have to call:
RASDIALPARAMS rdp = {0};
rdp.dwSize = sizeof(rdp);
lstrcpy(rdp.szUserName, "PJ");
lstrcpy(rdp.szPassword, "pwd");
lstrcpy(rdp.szEntryName, "Second Connection");
RasSetEntryDialParams(NULL, &rdp, FALSE);
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thanks David, I will look into these functions.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I am writing a program that does installations similar to InstallShield or MindVision's Installer VISE. I know that a good installer should have an option to allow the user to select an install directory but I was wondering if there was any alternative to SHBrowseForFolder() that is more flexible to browse for folders without writing a total custom dialog.
Pplshero54 thanks you for your assistance
|
|
|
|
|
pplshero54 wrote: ...I was wondering if there was any alternative to SHBrowseForFolder() that is more flexible to browse for folders...
What is it (not) doing?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Sorry, i meant that is there a way to specify a starting folder, create folders, and/or limit the user to select locations on a hard drive by using SHBrowseForFolder().
Pplshero54 thanks you for your assistance
|
|
|
|
|
pplshero54 wrote: Sorry, i meant that is there a way to specify a starting folder, create folders,
What's wrong with:
BROWSEINFO bi = {0};
char szFolder[MAX_PATH];
bi.hwndOwner = GetSafeHwnd();
bi.lpszTitle = szFolder;
bi.ulFlags = BIF_USENEWUI;
SHBrowseForFolder(&bi); pplshero54 wrote: ...and/or limit the user to select locations on a hard drive by using SHBrowseForFolder().
I prefer to do this at the OS level. You have more control and the code does not need to change if more/less security is needed.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi,
I have a litle problem with compiling my help files. The application I'm developing is an MDI app created with the Visual studio wizard and has WinHelp. I created my own html help and I don't have the need for winhelp in my program any more so the question is how can I compile my program without winhelp or let's say how can I extract winhelp from the app?
Thanks
|
|
|
|
|
Raul Simcic wrote: ...how can I compile my program without winhelp...
Remove it from the project's dependencies.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I know in a program , you can create some threads,and assign different priority
my question is: how to programmtically give your main thread the highest priority? Thanks alot!
|
|
|
|
|
The SetPriorityClass function sets the priority class for the specified process. This value together with the priority value of each thread of the process determines each thread's base priority level.
|
|
|
|
|
jinzhecheng wrote: how to programmtically give your main thread the highest priority?
Why would you want to do this? It would all but totally disable the OS.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Here is the reason:
Say I am testing the speed (I/O reading writting).
I want the Max performance , the code would be like:
tStart = getCurrentTime();
do{
reading();
writting();
}
span = getCurrentTime()- tSpan;
How can I ensure those steps are not interupted?
|
|
|
|
|
The first thing to note is that GetCurrentTime() has been deprecated by GetTickCount() . Second, calling SetThreadPriority() with a priority greater than 11 may cause disk caches to not flush, hang the mouse, and so on.
jinzhecheng wrote: How can I ensure those steps are not interupted?
By using a critical section (e.g., InitializeCriticalSection() ). I'm not sure you actually want to do this, however.
If you are simply wanting to time a section of code, GetTickCount() is the way to do this. Since Windows is not a RTOS, you'll not ever get 100% accuracy. For example, let's say that, per your watch, the code took 5 seconds to execute. However, span had a value of 6000, or 6 seconds. That means that the code was preempted for a total of 1000 ms. This is not necessarily a bad thing. It's much like weighing yourself at home on a scale that is not 100% accurate. Whether it shows you to be too heavy or too light, it doesn't matter as long as it's consistent. By comparing one weigh with another from the same scale, you can judge for yourself whether you are gaining or losing weight. Make sense?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
i need help with input plz
how do i get input for hour and minute if the time is entered as this format hour:min
|
|
|
|
|
There is insufficient information to provide you with a useful answer (e.g., how was the time acquired). In a very general sense:
char *pTime = "12:59";
char *pSep = strchr(pTime, ':');
int nHour = atoi(pTime);
int nMin = atoi(pSep + 1);
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hello,
I wonder how to disable the automaic menu enable/disable for CFrameWnd mechanism in eVC 4.0, I thought it could be done by setting the m_bAutoMenuEnable to FALSE?
Am I wrong with that? How can I accomplish it to stop that automatism?
Thnaks a lot...
Martin
|
|
|
|
|
Thank you, found out myself! It´s always the same: Searching two hours for a solution, then decide to ask the forum, then try again and find solution self within 2 minutes!
Here is the solution: Subclass a CMyMenu from CMenu and overwrite
"void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)"
in this new class.
In this function do nothing, so the automatism doesn´t work.
Greez...
|
|
|
|
|
Hello,
I have a Single Document Interface application generated by AppWizzard. The title bar of the application displays "Untitled - MyApp". I want to get rid of the "Untitled -" so the title bar just reads, "MyApp".
Any suggestions?
Thanks!
-Ian
|
|
|
|
|
go to the resource editor, then check the SDI frame properties and search the caption...
you could also do it at run time with a little SetWindowText() on you main frame...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Right you are! And here I was thinking I'd have to override one of the CDocTemplate methods... I guess I over-thunk this one... lol...
Thanks!
|
|
|
|
|
|
Isn´t it just AfxGetMainWnd()->SetWindowText("MyApp")? Didn´t try, but it´s a suggestion...
Greez! Martin...
|
|
|
|
|
Most folks use:
BOOL CMainFrame::PreCreateWindow( CREATESTRUCT &cs )
{
cs.style &= ~FWS_ADDTOTITLE;
return CFrameWnd::PreCreateWindow(cs);
}
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
D'oh! Yes, you are right! (I definately over-thought this one... ) Thanks alot!
|
|
|
|