|
Hi:
How can i disconnect a RAS-communication programmatically ? for example internet connection such as Norton AntiVirus after LiveUpdate.
is there any API or Message to do this ? please help me.
Best Regards.
|
|
|
|
|
There is an API for Ras communications. The functions all begin with "Ras". I think you will need to enumerate the opened RAS connections in order to retrieve a handle, and then close it.
|
|
|
|
|
Hi I hope someone can help, I am trying to convert a string of ascii characters to their decimal or hex equivalent. I am reading the characters from the serial port using the comms api, then storing them in a Cstring buffer. I then try to convert them using the following
char *szTheString = (char *) (LPCTSTR) m_sCommsOutput;
int array[100] = {0};
sscanf(szTheString,"%d",array);
This seems to interpret the whole string as a number and just stores a large number in the first array element. How can I convert each individual array element i.e. a = 30 or whatever? Any ideas would be much a appreciated.
Andy
|
|
|
|
|
I think you will have to parse the string m_sCommsput retrieving each char, and store it in the table.
~RaGE();
|
|
|
|
|
so do something like
for (int i = 0; i<=sizeof(szTheString);i++)
sscanf((szTheString+i),"%d",&array[i]);
??
Andy
|
|
|
|
|
yes. note that you can keep your original CString :
for(int i=0;i<=m_sComOutput.GetLength();i++)
{
array[i]=m_sComOutput[i];
}
mmhh... looks odd, but this should work (You make me doubt There must be a better way to do the conversion )
[edit]
Indeed, you just need to do :
char *array=(char *)m_sCommOutput.operator LPCTSTR();
..and array contains your ASCII codes... I'm dumb
[/edit]
~RaGE();
|
|
|
|
|
Not providing an example of what you are after, I can only assume. See if strtol() is of any help.
|
|
|
|
|
int nLen = strlen( szTheString );
for( i = 0; i < nLen && i < 100; i++ )
array[ i ] = szTheString[ i ];
This is very simple and it doesn't seem to me that I am understanding your question right. In case you are reading numbers as ascii characters, i.e. you have a stream of data going through your serial port, like 30, 40, 11, 100... etc., then it would be different. Could you please be more specific because I am not very sure about your question?
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
hello,
I need something like a table control to display data in line and
columns. How can I do ?
I tried a CRichEdit text but that's not the good way since I have
to used the protected property to avoid the modification of separators,
and I can't avoid insertion anywhere !!!!
Thanks,
Tabs
|
|
|
|
|
hai Anonymous,
Even i was trying for the same kind of utillity and used grid controls(an activex control utility) for this purpose . even u can try grid controls and see if it fits ur requirment.
I had some problems doing the above so if get or come across a better idea plz do share it with . I am trying to implements table just like in MS-Word.
Thanks in advance
|
|
|
|
|
this one[^] works great, and you can also use grid ActiveX controls provided with MS windows (flexgrid, dbgrid)
|
|
|
|
|
|
how to add user menus on right click event of the mouse in the web browser ctrl
|
|
|
|
|
|
Hi !
MSDN states that:
<<on certain="" versions="" of="" microsoft®="" windows®,="" the="" stretchdibits="" and="" setdibitstodevice="" functions="" allow="" jpeg="" png="" images="" to="" be="" passed="" as="" source="" image="" printer="" devices.="">>
But how can I load a JPEG or PNG image ?
Can I do it without using COM ?
|
|
|
|
|
The very best way IMHO is to use GDI+.
Regards,
BB
|
|
|
|
|
If you are using VC++7 (MFC) you can use the new MFC class CImage. It allows you to load and manipulate JPG, PNG, GIF, BMP formats.
Very simple.
Art
|
|
|
|
|
I'm not using MFC at all.
I only searched through the documentation on StretchDIBits and other bitmap API functions which reads:
Windows 98/Me, Windows 2000/XP: StretchDIBits has been extended to allow a JPEG or PNG image to be passed as the source image.
So I was wondering how to pass a JPEG pr PNG image to this function, maybe I can read from the disk ????
|
|
|
|
|
If not using MFC then I would suggest using GDI+ as was already suggested.
Image::FromFile("PathToYourImage.jpg");
Art
|
|
|
|
|
Hi guys!!!
In my application,I have to copy a indefined quantity of files in different folders.
Each folder can contain different quantity of data ( ex: folder1:400MB,folder2:1.5GB etc..)and if necessary it'll be created a new folder during the copy.
It shouldn't be a problem to implement it and check the max value for each folder,but the location of each files is collect in a table in a Database and after that it'll be necessary to update the same table with a new position of each files.
I'd like to know if someone have already met a problem like this and in particular if it already exists an algorithm that permit to optimize the copy of files in order to save space.
Thanks in advance for help.
And I'd like to wish at all comunity GOOD EASTER!!!
Andrea
|
|
|
|
|
Hi, everbody.
I made a simple screensaver that displays a piece of text and the name of the current user. I use scrnsave.lib and use getenv() function to take the username. It works fine when I click to myscreensaver.scr file and show the name and the text but when I copied it to WINNT\system32 and select myscreensaver to be the one from display properties it opens an gives an error then close(it dose not give error also at preview mode). When I take out getenv() function it works again. So I think the problem is trying to read enviroment variables from a screen saver application. Is there a method to read enviroment variables that does not cause error and please think that how to read enviroment variables when the screen saver is password protected in NTs.
karanba
|
|
|
|
|
Have you already tried to see what the getenv() returns when your app is used as a "normal" sceensaver ? (messagebox...)
~RaGE();
|
|
|
|
|
Yes. It return the true value. It gives error only when I select it as my screen saver from display properties and wait to appear!?
karanba
|
|
|
|
|
It sounds like Windows doesn't create an environment block for screensavers when it runs them. Instead of retrieving the user's name from an environment variable, just use the API function GetUserName .
Software Zen: delete this;
|
|
|
|
|
When I do a build, it would be very useful to put hte build date/time in so when the application runs this is displayed.
I can't use the file stamps because when its installed or copied these change.
Any suggestions ?
Thanks everyone
Elaine
The tigress is here
|
|
|
|