Any way to force process to unload library???? I working on update component ( oracle ), it seems i can do LoadLibrary and FreeLibrary when needed just ok, except for dll's been locked by OS. I am aware of debug setting for that tells XP to unload every library it is not been used, but this is way to drastic. Couple of other options comes to mind, but I don't want to reinvent the wheel and not even sure it would work. 1) From process A create process B, when done exit B hoping cleanup would unload DLL or may be just issue plain kill. 2) allocate memory, load dll (PE), do fixup entry table etc etc etc as long as darn LoadLibrary is not been used. 3) Call freelibrary until XP frees stupid library or I blow away my stack. 4) Other options? Thanks, Brian
Brian Shifrin
Posts
-
FreeLibrary question -
Accessing all child windows from the main windowThere are plenty of ways to accomplish this... You can iterate with GetWindowTop, GetNextWindow; To get class name: GetClassName If you are the one creating them make all windows support some protocol: make them all respond to some message like "WM_APP+100" with some value, or use existing message such as WM_GETTEXT. If not, install some hook via InitCommonControlSex.... Anyway... good luck
-
want help about scroll barNormaly you should set timer, when in drag mode and cursor x pixels from top; and then inside OnTimer handler scroll window. Brian
-
Passing DB handle between applications>Is anyone aware if it is possible to pass a db handle between two seperate applications? Behavior varies from one database to another, from driver, etc etc etc. With Oracle sqlnet api handle may be can passed btw processes, also not supported. SqlLib handle, sqllib api can be passed safely cross boundary and I think is supported. ODBC drivers do NOT support such behavior, it may or may not work with next update of oracle or vendor driver. Proper solution would be to build out of process STA com object, that performs access to database.
-
How could print a line without ending the page?StartDoc / EndDoc - designed to protect multipage documents from interspersed with others. PrintJob is suspended until EndDoc is called. >How could I do printing like the POS terminal printer? For remote spoolers - you can not, should not, and will not be allowed to; local - open device e.g. par port/usb and write directly. Even if local with direct write it still likely not work with most modern printers: laser printers, etc .... Brian
-
How to get the user group in win NT/2000/XPNetUserGetGroups or IADsUser::Groups
-
dll build problemThat checkbox never worked for me.... I would modify .dsp to: LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo TargetPath=.\Release\My.lib from LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 /nologo /subsystem:windows /dll /machine:I386
-
required info about projects in c++A.I? Stock trading systems, Power switches Router links status info CPU branch predictions MxN queues (M people in N lines at the register) Traffic control sytems.
-
Slow Editor in VC+ 6.0- Are you using visual assist, or any other pluggings? See if you can turn'em off improve performance... Another option is to delete *.ncb, *.opt, *.clw... If *.opt is corrupt vc editing will be very slow. Brian
-
Member function pointerWith classes you have two options: 1) make function static, so that all objects of the type MyClass reference the same static function. In this case you can use MyClass::FunctionNeededPointer 2) Function you are trying to pass is not static. To pass function pointer you should use something like "this->FunctionNeededPointer", since function obviously has very little meaning outside of class scope... 3) Here is how you can define function type typedef void (MYFUNCTION)(float*,int,int); void Function(MYFUNCTION *p); { Function(&this->FunctionNeededPointer); } Brian
-
VB COM problemVB6 can only create STA components, and in my opinion is worthless for web development. Second: something wrong with your design don't you think? When web component takes 85 minutes to complete? Brian
-
if my apps trial period expiredNeither, I would think you want to show nice dialog: "Trial period expired", visit website to purchase licenses and get free upgrades. Writing over executable with "0101" is childish and not productive. On the day X user could have clicked on your executable by mistake and closed app. Next thing he/she knows application exits w/o warning... Is it broken? Messed up? Would writing over executable stop even novice hacker? I doubt that. All it takes to nop area "call WriteFile[A]"... Brian
-
Bug in CStringT operator=The same code was VC6.. It causes read out of bound warning in BoundChecker & Purify, but also pretty harmless. Also note, if you change (via WideCharToMultiByte) - 1 to (via WideCharToMultiByte) you will break ATL CComBSTR, and may be some others.
-
When I meet the character "%"...Most databases require special characters to be escaped if they are part of sql. For some databases you can choose you escape sequence others have predefined '\'.... Characters '[,=+-&%#!@">
-
Is it possible to restart my application from within my application?Yes, few solutions awailable: 1) External executable, when given control restarts app. 2) Create batch file that restarts application with flag delete on close, execute it, and exit application. 3) Same executable, or new version of exec or exe making copy of itself, with when started with "reboot" command option, waits for executer to close, places itself into original directory, and re-starts itself. I used to use (1), now I use (3) for self-update.
-
CMap Efficiency???CMap is ok, STL is better.... CMap uses hashbuckets, efficency based on size of the data, hash alg, etc etc etc.. Multiple keys can be achived by multiple maps with . You can reduce initialize penalty, by initializing maps as needed.. Brian
-
printer help?There aren't any good way to get printer status in windows with most print drivers.... 1) First 2k, and XP does not poll printer status unless you submit a job. 2) GetPrinter return status success even if printer turned off 3) Let's say you submited job... and do something like GetJob.... - Error reported after ~60 seconds - Most print drivers will only report "printer out of paper" as universal error, printer offline / opened / low inc -> "out of paper". - Now let's say spooler returned status printed and job removed from the job queue. It really means nothing. Printer buffers are so large these days your entire job could be spooled to printer buffer before printer even tried to print. - You detected somewhat error in the print queue, and decided to cancel the job... it takes about 90 seconds to cancel print job... If during those 90 seconds error condition is fixed, job will be printed anyway... I wrote some code in the past for "secured & guaranted" check printing and it was a pain ... Had to exclude number of printers ( badly written drivers )... Also AddMonitor is helpfull but only for local printing....
-
Kill a process!!Instead use ShellExecuteEx and get Process handle, followed with TerminateProcess.... Brian
-
upside down Bitmap imagedc.SetWindowOrg(m_rect.TopLeft());
-
Does it have some memory leak?No it is not possible to have a leak, char[100] allocate memory on the stack, when you exit function memory will be simply popped. In fact if you had allocated memory with: a = malloc(100); a[1] = NULL; free(a); you would not be leaking, de-allocator knows what size you allocated.