|
In Access, first delete the rows, then switch to design mode, change the datatype of the autonumber field to whatever, save the table. Change back and save again!. This can only be done on an empty table (I think), and I am not sure you can do it externally. If it is possible you would need to drop and then create the table using SQL syntax.
Consultant, system/web developer.
IMS Consulting AB, Sweden
|
|
|
|
|
Another way to do it is after deleting the rows compact the database.
Best regards,
Mark
www.mjsoft.co.uk
|
|
|
|
|
I'm looking for code samples for the Navigate2 function. Can anyone point me in the right direction?
|
|
|
|
|
Have you tried the following?
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/WebBrowser.asp
|
|
|
|
|
Hi there!
I'm looking for the way for the hands off install of the new printer driver on multiple workstations. I've tried to do it myself according to MSDN (AddPrinterDriver, AddPrinter, ...) with no success.
I don't want to invent the wheel any more, so I'll be very thankful for any trick, tip, link, etc. concerning:
1. Ready to use utility for this purpose (if any exists).
2. Article with good explanation of the driver installation process.
3. Tools for INF file processing/interpreting, especially INF file for printer driver.
Thanks in advance.
Regards,
Gennady
|
|
|
|
|
Hi!
Does anybody know where it is possible to obtain a free C++ source code for BCD or String Arithmetic (the last one is even better for me). The problem is I'm developing some Banking SW, so I can't use a floating point arithmetic in it, because it is prohibited by the country law. The only solution I know at the moment is to use the RogueWave RWDecimal<> template class. But the RW library is huge and imho ugly, I don't want to be tied to it. In addition, I need not so much functionality: only '+', '-', '*', and probably '/' operation... Could you help?
PS: Of course, it is possible to start writing the necessary class from scratch, but better is to take somebody's code and adjust it for my needs.
Best Regards,
Dmitry Leonov
|
|
|
|
|
Hi there,
If you have some source code to lock some key
in the keyboard, F1 .. F12 and Ctrl and Alt and Shift,
please send it to me!
Thank you very much!
|
|
|
|
|
I have searched this forum but havent come up with any useful results. I simply want to be able to read the input from a bitmap file, nothing fancy, I dont want to display bitmaps, just be able to access the value of a pixel at (x,y).
Any ideas/ places I can learn more about this/ code I can use?
Any help is appreciated...
cbb@andrew.cmu.edu
Cassidy
|
|
|
|
|
Is it true that bitmaps are just a collection of paired bytes? When you open a bitmap (in hex format), you can see the "lines" that comprise to sequence of on/off bits.
Try creating a small 4x4 or 16x16 bitmap with known values:
0110 = 0x06
1001 = 0x09
0101 = 0x05
1111 = 0x0F or if adventerous,
0101010101010101
1010101010101010
0101010101010101
...
(checkerboard pattern)
then you can use byte-size arithmetic to access "x,y" value. x*sizeof(byte)+y*sizeof(byte)
and check against known values for your template bitmap.
Sorry if too abstract, but this may be a lead that you could use.
John
|
|
|
|
|
One of our customers is going to translate the Windows application that we have written for him. The easiest way to achieve this would be for me to send him the resource file. Once translated, I would only have to rebuild the application using this file.
Unfortunately, most of our customers do not have the Visual Studio installed, nor has this customer. Does anyone know a standalone application (preferabely freeware) that would allow one to edit resource (.rc) files in a similar way as in Visual Studio?
|
|
|
|
|
You can directly edit the resources in binaries with VC on NT. Assuming your customer has VC and NT, of course. That way you don't have to rebuild anything.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Another option is to use a program such as ResHacker, which allows you to modify the resources without Visual Studio. It should be avaliable at:
|
|
|
|
|
Sorry, let me try that address again:
http://rpi.net.au/~ajohnson/resourcehacker/
The rest of my message mentioned the Win32 API functions you can use to modify the resources of a binary file at runtime:
BeginUpdateResource
EndUpdateResource
The only problem with these is that the format of the String Table is anything but easy to work out. I certainly couldn't find any documentation for it!
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
I have an app that uses a hosted browser control (IE control) to print using print templates. I would like to pragmatically change the destination printer because currently I'm limited to always printing to the default printer set for IE. So far all of my research has turned up empty. According to MSDN it seems that due to security reason you can't change the printer.
My app is written in VC++ and is hosting the browser control that I'm using to print. If any one has some suggestions on how I can pragmatically change the print I would appreciate the help.
Seems that this is one feature MS overlooked that is really needed if they want you to reuse the browser control in your own apps.
Hawkins
|
|
|
|
|
Hi all,
I'm looking for a function to check wheather a given NT account (not the current!!) has administrator rights.
Has anybody things like that in the pocket?
Best regards,
Jo
|
|
|
|
|
Have a look at the netapi.
Isac
|
|
|
|
|
Hello Johannes,
The following sample code may help you :
#include <windows.h>
#include <lmerr.h>
#include <lmaccess.h>
#include <lmapibuf.h>
void main()
{
WCHAR wszServer[] = L"\\\\server_name";
WCHAR wszUserName[] = L"user_name";
NET_API_STATUS net_api_status = 0;
GROUP_USERS_INFO_0* pgroup_users_info_0 = NULL;
USER_INFO_2* puser_info_2 = NULL;
DWORD dwentriesread = 0;
DWORD dwtotalentries = 0;
net_api_status = NetUserGetGroups
(
(LPWSTR)wszServer,
(LPWSTR)wszUserName,
(DWORD)0,
(LPBYTE *)&pgroup_users_info_0,
(DWORD)8096,
(LPDWORD)&dwentriesread,
(LPDWORD)&dwtotalentries
);
net_api_status = NetUserGetInfo
(
(LPWSTR)wszServer,
(LPWSTR)wszUserName,
(DWORD)2,
(LPBYTE *)&puser_info_2
);
if (pgroup_users_info_0)
{
NetApiBufferFree (pgroup_users_info_0);
pgroup_users_info_0 = NULL;
}
if (puser_info_2)
{
NetApiBufferFree (puser_info_2);
puser_info_2 = NULL;
}
}
The following is a summary :
1. NetUserGetInfo()
1.1 This API will return to you a USER_INFO_2 struct in which the "usri2_priv" field (type DWORD) contains one of the following values :
1.1.1 USER_PRIV_GUEST
1.1.2 USER_PRIV_USER
1.1.3 USER_PRIV_ADMIN
If USER_PRIV_ADMIN is returned, this indicates that the user has Administrator rights.
1.2 When you no longer need this USER_INFO_2 struct, call NetApiBufferFree() to free the memory for it.
2. NetUserGetGroups()
2.1. The motivation behind the use of this API is to get a list of Groups to which a user belongs and then check to see if one of these groups is "Administrators".
2.2. The NetUserGetGroups() API will return to you an array of GROUP_USERS_INFO_0 structs. Each element of the array contains a pointer to a Unicode string which is the name of a Group to which the user belongs. The last two parameters "entriesread" and "totalentries" will help to indicate to you how many elements were returned in the array.
2.3. However, I found this API a little strange in the sense that the "Administrators" group does not seem to be used.
2.4 When I specified "Administrator" as the user name, NetUserGetGroups() returns "None" as the group name.
2.5 However, you can use this API to obtain a list of Groups to which a User belongs.
2.6 Like NetUserGetInfo(), you need to delete the array of GROUP_USERS_INFO_0 structs by calling NetApiBufferFree().
Hope the above will help you, Johannes. Best of luck.
Regards,
Bio.
|
|
|
|
|
Bio,
thank you very much for your detailed contribution!
I have one more question about your solution:
Does NetUserGetInfo() return USER_PRIV_ADMIN if the user is member of the "Administrators" group or do I always need to search the groups returned by NetUserGetGroups?
I would like to avoid using NetUserGetGroups, because my problem with searching the groups is, that we are running in several language environments. So the group "Administrators" reads "Administratoren" on a german system. And we support more languages than those two.
Again,
thanks a lot!
Jo
|
|
|
|
|
Hello Johannes,
You're most welcome, Johannes. About your question : Yes, NetUserGetInfo() will return USER_PRIV_ADMIN if the user is a member of the "Administrator" group. The user may belong to several groups but as long as he/she is part of the Administrator's group, USER_PRIV_ADMIN will be returned.
I understand your concerns over the use of NetUserGetGroups(). If detecting Administrator rights or being part of the Administrator's Group is all that is needed, I would vote for NetUserGetInfo().
Regards,
Bio.
|
|
|
|
|
Hello Johannes,
I have another suggestion for you. There are three other functions that you can use : NetLocalGroupEnum(), LookupAccountName() and NetLocalGroupGetMembers().
1. The NetLocalGroupEnum() API retrieves information about each local group account on a target machine. It returns the group information in an array of LOCALGROUP_INFO_0 structs.
2. You can then iterate through this array and call LookupAccountName() on each group name. You will be returned an SID for that group account.
3. Now, the important part of this suggestion is the fact that NT uses a constant SID value for some well-known accounts like EVERYONE or WORLD. I'm very sure that the "Administrators" group account is also one of these well-known Group Accounts.
4. The SID string for the "Administrators" group should be "S-1-5-32-544" on all NT systems. Please verify this, Johannes, before using my suggestion.
5. Now, once you have found the "Administrators" Group Account, call NetLocalGroupGetMembers() to get an array of LOCALGROUP_MEMBERS_INFO_1 structs. Each element of the array will contain information on the User Accounts that are part of the given Group Account name.
6. You can use this method to obtain the list of User Accounts which are part of the "Administrators" Group Account on a machine. The wonderful thing about these APIs is that you can make these queries on any machine not just the local machine.
7. I have previously written an article in CodeProject with sample code and demo program that closely matches the details above. My sample program collects NT Remote and Local Group and User Account SIDs and store them in an INI and an XML file. You can run my app and collect these SID info at a later time by accessing the information in the output INI file or the XML file.
8. The following is the link to my article :
http://www.codeproject.com/useritems/collectsid.asp
You can also search for it under "Free Programming Tools" section of CodeProject.
9. I'd also like to refer you to a great article by Mark Russinovich (of SysInternals) where he gave a very good introduction to WinNT Security :
http://www.winntmag.com/Articles/Index.cfm?ArticleID=3143&pg=1
In this article he also mentions some good points about SIDs and the existence of "well-known" or "built-in" SIDs.
10. I hope the above info will help you further, Johannes. Best of luck.
Regards,
Bio.
|
|
|
|
|
In a streaming application which would seem the better, TCP or Unicast UDP? Which has less overhead, reliablity, etc. Any help would be greatly appreciated.
Stephen Caldwell
Blackfission, CEO
http://bf.steffc.yi.org:81
Sonork ID: 100.10100
|
|
|
|
|
Anyone have a CStatic control that has scrollbars? I could use CEdit with read-only, but it does not look very good on PocketPC.
|
|
|
|
|
I wanted to monitor the number of upload and download bits, in realtime, under Windows 98 and 2000. Does anyone have any idea of doing it? I would be doing it under VC++.
Many ThanXs...
|
|
|
|
|
Can anyone roughly tell me how i can send AT commands through a palm with CodeWarrior program.I have succesfully open the serial port for transmitting data but there's error when sending out AT commands.I use the hyper terminal to check my output data but it does not coincide with the input data.
|
|
|
|
|
Hello,
in my MFC app I'm using a modeless child dialog to display some extra information. When the input focus is on the modeless dlg, the accelerators of the main app are not working.
What to I do to make things better?
Thomas
|
|
|
|