|
Ahhh, you are wanting to create a RAS entry, not a network connection (I think). For that you'll need to use the RAS-related functions. I'm not sure which is the exact one, but start with RasCreatePhonebookEntry() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thank you very much! Now I know the clue to this problem.
However, the function RasCreatePhonebookEntry() only show a dialog for user to create a connection step by step. I need a function to do it programatically. All properties are set programatically.
Does the function RasCustomEntryDlg() help me? Or I have to find another way?
|
|
|
|
|
You'll need to use RasSetEntryProperties() instead.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi David Crow!
It is a long time I don't contact with you. Can you ask you one more question?
I downloaded a VPN client software in the site http://www.umkc.edu/vpn/[^]
After installed, the software create a connection in "network connection". The thing is that new connection is very strage. It has its own dialog and its type is "connection manger".
I have been trying to figure out how the software can do that for a long time. Unfortunately I can't find the answer.
Can you help me?
Thank you very much.
Long
|
|
|
|
|
I have a report layout for a CListControl.
The control comes up with nothing selected and I'd like
to select automatically the first item as a default selection.
For List boxes SetSel would do this for me.
I can't find a similar command for this control.
It should be simple, but I don't see it.
Thanks
Ilan
|
|
|
|
|
Assuming you mean CListCtrl, Try the following:
UINT uflag = LVIS_SELECTED;
SetItemState(0, uflag, uflag);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
It worked. Sorry I missed it, but thanks for your help.
|
|
|
|
|
Does anyone know how to create dynamic control depends on input configuration ..(specification for another application)...
this project should create an another application with controls specified in the input configuration dialog
for example:
if channels =2 means ..it should create 2 checkbox control..
if i/p voltage value is 5 to 10 means it should create listbox control with the values 5 to 10 automatically...
similarly
if any command name(ex..trigger fn) & value depends on command name means
it should create control appropriate to that...
after dynamically creating all the controls on new dialog window...
new dialog window should be seperate exe application(not related to main project)
regards
jalal
|
|
|
|
|
hiho@ll
anyone knows how to write a exe which is currently running?
what i need:
solution 1:
1. execute test.exe
2. download updated test.exe
3. overwrite test.exe with the updated test.exe
solution 2:
i know i could download in a temporary directory
create a bat file
close my application and execute bat file, which copys the exe, executes the new exe and deletes itself (test.bat)
but, how i can execute the bat file and make sure the test.exe application is closed so i can overwrite it with the downloaded?
OR
is there a way to do it like solution 1?
thx@ll
|
|
|
|
|
A slight twist to solution 1:
1. execute test.exe
2. test.exe executes checkupd.exe
3. checkupd.exe checks for updates.
4. if any are found:
4a. terminate test.exe
4b. download test.exe
4c. execute new test.exe
5. checkupd.exe is ended
Otherwise if you must do everything from within test.exe, check out the MoveFileEx(..., MOVEFILE_DELAY_UNTIL_REBOOT) function.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I do something similar to this for getting my programs to update themselves from the web. But I use an MSI for distribution so that is the second program in the scenario. I like your solution because you can easily execute the updated program when it has finished.
My method was:
1. Check for updates
2. If any found, confirm and download into user Temp directory
3. ShellExecute the MSI package (/qb) just downloaded
4. PostQuitMessage on self
The installer updates the program and then leaves the user back at the desktop. I never thought of a good way to restart the application. I might try something like yours next time.
|
|
|
|
|
Hi all!
I have a really strange problem in my project. It is a rather large windows application with a lot of different Dialogs. I'm using VisualStudio 2003 and the projcet is a Win32 (not .Net) project.
The problem is that Windows (or something) sends strange WM_WHATEVER to my main window.
I added the function:
BOOL CApp::PreTranslateMessage(MSG* pMsg)
{
//Onni is blocking a nasty kind of message
char txt[100];
if((pMsg->message == WM_DEVICECHANGE || pMsg->message == WM_TIMECHANGE || pMsg->message >= 0xc0000))
{
MessageBox(NULL, itoa(pMsg->message, txt, 16), "Caught Windows Message", MB_OK);
pMsg->wParam= NULL;
return TRUE;
}
return CWinApp::PreTranslateMessage( pMsg );
}
This blocks all messages above 0xc000 (and the WM_DEVICECHANGE and WM_TIMECHANGE but I know I dont want them, it causes a crach every time if I let them trough)
In the MSDN I read that messages above 0xc000 are application defined. And that a certain function is responsible for giving uniqe values to all the applications that wants to create new messagetypes.
I have tried to block them all. This works on most computer. But sooner or later it gets stuck in a loop: I click the ok button in "Caught WindowsMessage" and as soon as the messagebox is gone another with the same number shows up. An eternal loop, all thats left to do is Ctrl-Alt-Delete.
If I let them all trough the program crashes after a few minutes with no explanation. And when I run it in debug mode I can trase the error through the callstack to the PumpMessage() with a Windows Messages with a number like 0xc0d1
Whats going on?
I never asked for those messages!
How do I get rid of this problem?
The application is due to be realeased soon and panik is creeping up on me.
Some describing smileys:
/Onni
Onni Qvickstrom
onni.qvickstrom@genline.se
|
|
|
|
|
Messages in the range 0xC000 - 0xFFFF are registered messages, registered using RegisterWindowMessage .
If you don't understand a message you should always pass it down to DefWindowProc , which MFC will do for you if you don't add a handler.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thats what I did initially.(Let all the messages through.) The problem was probably something completly different.
I reinstalled VS7 and cleaned up a few ASSERTION errors in my code. And pof! The problem was gone.
Thanks for you help!
Some describing Smiles:
/Onni
|
|
|
|
|
Hi all,
I want my application to output some short text on screen when critical error happens. I saw some programs did that (normally with sound mute setting etc) but have no idea how is it possible?
Appreciate any help, or even better some sample code . Thank you in advance.
Will
|
|
|
|
|
|
What I've forget?
There is Ownerdraw Combobox class (C++ but not MFC), when creating as dropDOWN type Control it works well ( when change selection in ListBox part - Edit part's text also changes), in the same way navigation correct displays text in static part at choice not Ownerdraw, but when style is Ownerdraw dropdownLIST - in static part I see nothing! Though at losing the focus of this combobox the text appears.
Help plz., any advice or small example!
Tanks.
|
|
|
|
|
Can anyone help me with an image i extracted from an XML file where it was encoded using bin.base64? It doesn't seems to be any of the known formats. Please contact with me by e-mail.
|
|
|
|
|
Hey all,
I'm trying to figure out how to directly write to a device in Windows. Basically, what I'm wanting to do is create an image of a device (specifically, a CompactFlash card that doesn't use a filesystem Windows recognises), store it as a file, modify it and dump it back to the card.
Currently, in version 0.001 of my program, I'm just calling dd for Windows using ShellExecute - this works perfectly, but obviously this isn't exactly acceptable for the final product! (and in the kludgy way I've done it, it locks the whole program and I can't implement a progress bar etc etc)
I'm HOPING it's as easy as using fopen and just treating it like a file from then on (sorry, that's my Unix background speaking)...
Any help would be much appreciated.
|
|
|
|
|
these Api may help you in achieving above
- CreateFile
- ReadFile
- WriteFile
you can refer for documentation of above api's in MSDN library.
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks for that - the MSDN entry for CreateFile explains it all quite nicely. I actually feel pretty foolish now since that's the same naming convention used in "dd for Windows" for accessing the drive (that is - \\.\x: where x is the driver letter)... Obviously I now know why!
|
|
|
|
|
And Frankly Speaking i never used these api's i have just used the wrapper of it when i communicating with smart cards.
hope it's work well for you
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I have a negative double number, say, -11.0, when I use pow() to find its power of 1/3, I return NAN.
double a = -11;
double power = pow(3, -1);//1/3
double result = pow(a, power);
the result is not equal to (-11)^(1/3), but is NAN
However, when I change the power = 3, the result is normal.
Is that pow() cannot find a x^y for x<0 and y<1?
thanks
|
|
|
|
|
I guess that pow does not find roots of -ve numbers since all even roots are imaginary.
If you are always getting the cube root for your negative numbers.
You can do the following:
1) Make the number positive.
2) Get the cube root of the positive number.
3) Make the answer negative (multiply by -1).
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hello all...
I've been developping an application to render Videoclips or still images to fullscreen, with the ability to fade smoothly between clips.
I was facing a great CPU consumption (>50%) using DirectShow Filters and VMR9. Furthermore it was quite hard to make the system stable since the filtergraph is modified each time a video clip of a different format is added.
Now I was checking out the Video for Windows (VfW) capability of the Platform SDK. I wonder if it would be worth a look at. An advantage of DirectShow surely is the independence of formats, as much as I know VfW works mostly with AVI.
Does anybody have some experience with VfW?
How about the other formats like MOV or MPG?
Regards
|
|
|
|