|
i will thanks a lot
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
hi, i found the solution this weekend , i just needed to add comsuppw.lib ,
thanks for all your help
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
OK so this is kind annoying:
I have a an environment varialbe that I want added to the Users env vars, and tehn appended to the Users Path.
So I modify the HKEY_CURRENT_USER\Environment and add a value called FOO, that equals "c:\tmp\crap".
I then modify the path value and add "%FOO%" to the beginning of the string.
I close regedit.
Now I run a small program that does the following:
DWORD res = 0;
DWORD res2 = SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, &res );
if ( !res2 ) {
char tmp[256];
sprintf( tmp, "SendMessageTimeout error: %d", GetLastError() );
MessageBox( NULL, tmp, "Error", MB_OK );
}
else {
char tmp[256];
sprintf( tmp, "SendMessageTimeout res: %d", res );
MessageBox( NULL, tmp, "SendMessageTimeout lpdwResult", MB_OK );
}
I open the System properties adn sure enough a new env var has been added (FOO=C:\tmp\crap), and path now has the %FOO% value, expanded to "c:\tmp\crap".
I open a command prompt and type path:
Alas it does NOT see the expanded FOO value, and instead only prints out %FOO% (plus the rest of the path).
I had thought the problem might be with the installer, which performs these same steps. So I tried the above manually with regedit and running the little refresher program manually.
Obviously I am doing something stupid but I cannot find out what, nor has googling for this proved enlightening, other than to provide countless examples of the above code that *should* work.
The ultimate point of course, is to have some executable (a command line program) that would be located in the directory pointed to by FOO, and then be able to run it from the command line. This, so far, has not worked without rebooting.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
My first guess would be that you have too many environment variables, or those that you do have are too large. To test this theory, remove one of the longer ones and see if FOO and PATH show up properly.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Nope, no dice.
Still doesn't work.
I even tried clearingthe whole path. And made sure both were REG_EXPAND_SZ types.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Not that it matters, but I don't think that FOO needs to be REG_EXPAND_SZ type as there is nothing to expand.
I am able to reproduce the problem. Sometimes it works and sometimes it doesn't. The amount of time I wait after changing the variable but before opening a command prompt does not seem to matter. When I removed a few of my environment variables earlier, it was showing up correctly. Now it seems to be intermittent.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The one thing I found stated that programs don't have to process te WM_SETTINGSCHANGE message. If they do they return 0. Even if they do process there is no guarantee they will handle it correctly ( I love this, it just keeps getting better).
The solution proposed was to insert some kind of crazy system hook to "fix" this, but in the case of env variables I really don't understand what you'd do.
I would desparately love to solve this. Obviously programs like the DevStudio installer handle this (though you do end up rebooting, so maybe they don't handle it correctly after all)?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I want to make an MFC? app containing an edit box similar to the command line that can:
1. add a prompt on every line
2. notify parent on 'enter'
3. inhibit edit on all but the current line
Is there anyone who knows of anything existing or have an idea of how to achieve the above?
|
|
|
|
|
Sound like a typical CView window.
Kuphryn
|
|
|
|
|
so how do I accomplish it with the CView?
|
|
|
|
|
I have ben using 3rd party ActiveX controls on my dialog
based application. I have used the Tabbed dialog class
CMyTabCtrl - from codeproject - (6 dialogs in total).
All is fine apart from dialog 4 (tab 4), I keep getting an
Debug Assertion Error when I refer to any member variables
associated to any controls on this tab.
I thought is was just with the 3rd party ActiveX controls,
but it occures with a member variable tied to a standard
Windows button.
The variables are all NULL {000000} and I dont understand
why. I have deleted and replaced some of the controls, but
get the same error.
The use of member variables on other dialogs (tabs) are
OK - they work fine.
I dont want to restart this project as a lot of work has
gone into it.
Any idears out there?
|
|
|
|
|
Humm...
As you didn't post any code, consider doing some cross-reference checking. See what variables and functions you have in one of the dialogs (Not #4) and then compare the way you create this dialog to that of #4's.
Basically, see the logic behind all your dialogs: how do they work, how are they called. Then see how the ones which work differ from #4.
Last resort is to attach the debugger and step through the code to see what ASSERT command causes the assertion. This assumes that you have MFC Source Code installed. If you don't, then guessing and testing is the best way to go.
Perhaps you would post some code here ? I assume the Tabbed dialog is a self-standing class and the control forms (tab views) are members of this class ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks for your post.
The assertion error occures as soon as I make referecnce to any of the controls member variables.
It seems that the dialog is not being initialsed, but I can see no difference in this tabbed dialog than all the others.
|
|
|
|
|
Has anyone managed to get tear-off menus working in Windows (other than with the GTK, I mean!)
It would be possible to have a menu item with a line of dashes as its caption. It would be possible to make that item open a new window. But: is it possible to make that new window contain a fully-opened copy of an arbitrary HMENU?
You could make the "tear here" menu item open a copy of its own menu as a TrackPopupMenu item, but the popup menus only last for one mouseclick, and you can't drag them around like a window.
Those are just a couple of ideas, neither of which really works properly yet: are there more reliable ways of having tear-off menus?
|
|
|
|
|
please don't ...
the tear-off menus are one of the ugliest UI "feature" ever done; they were meant, I think, to replace toolbars functionalities.
I suggest you try implementing toolbars, and customizable toolbars ( to add/remove buttons ) instead.
but if you really want to, one way would be to create a palette-like window with buttons that represent the menu items.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
I'm trying to enumerate all hard drive partitions on a machine with GetDriveType(), and come up with total/free disk space figures and such, and have come across an "interesting" scenario...
If you use something like:
SUBST X: C:\TEST
...enumerating this "drive" will count the storage space of C: twice (obviously, since both are physically the same drive).
Is there any API that will let me identify SUBST'ed drives? I don't see anything returned by GetDriveType() offering any indication that this is the case, and GetLogicalDrives() doesn't seem to care either.
Comparing volume names isn't reliable, as I can (and do) have any number of drives/partitions actually using the same volume names.
What about the Volume Serial Number parameter of GetVolumeInformation()? Is it possible to have two totally different drives/partitions with the same volume serial number? My understanding is that this serial number is generated when the partition is formatted...and I'm thinking that yes, something like Norton Ghost would probably make the system use identical volume serial numbers for totally unrelated drives...
Note also that I'm aware that this volume serial number isn't the same as the hard drive's physical serial number--which might come in handy (?), but isn't easy to get to from a Win32 app...
Suggestions?
|
|
|
|
|
See here, here, and here.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hmmm....the first link uses a proprietary VxD (which obviously won't work on NT+), and the second and third links use WMI (which I can't assume will exist on the target machine)...
On the other hand, the first link identifies the Int21 call (function 71aah), so at least this gives me something to work with...
Thanks.
|
|
|
|
|
You can still call interrupt 21 functions from VC++. Just open an asm block, load AX and invoke int 21h
It should return a pointer to a table of the current state of drive mappings.
Just google on int 21h - it has been a few years since I have used it and can't remember the exact calls.
|
|
|
|
|
Hi everyone,
I have a UDP client running.
I wanted to know if I can use the flag MSG_PEEK when doing a Receive. I keep getting an error (WSAEMSGSIZE (10040)) which says the message is too long.
What is currently in the buffer is a 12 bytes message. I want to just peek at the first 4 bytes so that I know how to process it. I have a temp buffer declared as 4 bytes to store and determine what kind of message it is, but it keeps reading all 12 bytes, trancating, and returning an error. What I want it to do is peek at the buffer and then process each type of message. In the process method of each type, that is where I would like to take the info out the buffer.
I do this same method for TCP client and it works fine.
What should I be doing to have this perform like I want and how I have it in my TCP client app?
Thanks in advance.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
With UDP sockets you have to call ReceiveFrom instead of Receive. Thats why it works with TCP.
Bunburry
|
|
|
|
|
Developing, building, and testing. How do it the best? Learning from the world leader - Microsoft
I'm very interested in how the developing/build/testing workflow @ Microsoft looks like. I think Microsoft as world leader in software developing business must have a very good workflow. Does anyone know how the development flow @ Microsoft looks like?
I'm also interested in the workflow in your company perhaps the workflow in your company better then @ Microsoft? What do you think about test driven development?
Regards,
Gicio
|
|
|
|
|
Back when the company I was working for was embarking on a big BizTalk Server project, we had two Microsoft consultants come in for a week and brief us on what we needed in order to mature to the next level. I don't remember everything that was discussed but one thing that stuck with me was out of all the ideas/suggestions that are submitted (for new products or enhancements to existing products), only 10% of them are approved, which is why most of their products do very well. They can quickly determine if the work can be justified. If it can't, they don't bother with it. In most other companies, work is work, and it all gets done whether it has an ROI or not. It was quickly brought to their attention that Microsoft is the only company that could afford to be proactive, and that the other companies had no choice but to be reactive. They acknowledge that.
Shortly thereafter, myself and a few others took a trip to Redmond for some more training on getting the BizTalk Server project to its next phase. The net result was that BizTalk Server, as good as it was, was not yet ready for the task at hand. The other group that we were working with, Washington Publishing, was the copyright holder for an EDI document that was being fed into BizTalk Server. The output was supposed to be something generic that could be imported into SQL Server. Anyway, enough of that.
Microsoft definitely has some processes in place. For a price, they are happy to teach them to you. Surprisingly, most of what was taught to us was nothing new. It was mostly a matter of just doing it.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi.
My previous question was whether I need the platform SDk for WInsock. I want to use WSA.., connect, etc type of calls instead of MFC ones. I assume the answer is still the same and I do not need the platform SDK.
The next question I got is this. EACH port can only connect to ONE server. Is this correct?
I want to write a client class that will connect to a server. It will then spawn a thread to handle the reading of the data as it comes so as to get the data as soon as possible. If only ONE connection is possible, then I can just use the event method to signal that data has come in. Is this the best way? THis way I know when things come in and when a write is finished if I need it. I don't think I will have too many clients on the computer so that creating a thread for each socket port is probably OK. I just want to make sure my thinking is along the right lines.
THanks!!!
|
|
|
|
|
Each port can simultaneously connect to a single server, so that is correct.
However, you can start a seperate thread which monitors ALL the open ports. Afterall, checking a port isn't a long process, so this shouldn't cause any timing issues.
Now, instead of opening dozens of ports, I suggest that you formulate the data sent by the server, if that is possible. Place a identification number in front of each data packet to tell your program from which 'virtual port' this packet is coming from. This way you can open 'multiple' connections to a single server using only single physical port.
The event driven method is appropriate, considering that you created a seperate thread to handle the port. Now, when a port event occurs, the handler thread is notified. At this point, save the data to a temporary variable, free the port and notify your application that new data is available. This way the port is freed quickly, but the transfer of data from the port to the application isn't in a terrible hurry. This is called data buffering.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|