Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

Rassman

@Rassman
About
Posts
86
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Make use of 2GB of RAM + some virtual mem
    R Rassman

    mem mapped files would allow your OS to take care of the virtual memory for you, parts that your app is currently using will be shipped into real ram as you use it anyway. But in graphics this swap can be a be unintelligent, portions of yuor graphic can (and probably will) be shipped out whilst your app is working on another part (assuming non contigious memory blocks). But this might be too slow for your graphics work. So, perhaps a compromise, claim a contigious global space (locked) of a size suitable for one of your graphics, and then swap each of your graphics into here yourself to work on. You may then be able to refine it by deciding which parts of your code need the graphic in your own swap area (for speed) and which don't. We do it for the joy of seeing the users struggle.

    System Admin question sysadmin performance help

  • GetSecurityInfo on Samba
    R Rassman

    Does anyone know if GetSecurityInfo() is meant to work in full on Samba. I was getting security info from a function of my own on linux boxes, but this particular utility has to work on NT too. I'm not getting information back. I Checked the Samba development site, it isn't mentioned which leads mke to believe it should work. Parts that are not implemented (in full or part) are hilighted. I suspect then it must be to do with a Samba setting, unless I'm wrong and the function requires NT itself. We do it for the joy of seeing the users struggle.

    System Admin linux security tools

  • Hacking into system Dlls
    R Rassman

    I think that you may be confusing the key with the password. Lets say a hacker virus got onto your compuetr, then it managed to fool your anti-virus into thinking that changing a system dll is ok. Then the hacker finds and passes the key to himself. This part of cause is possible, so I'm not saying it can't be done somehow. We have to assume that not all software users are as aware as us here of how important security on a PC is. Anyway, all he has then is the key, not the password. If you were using this program for, say, a secure site, then you would pass the key to your users, depending on your security system it could be . once only . on a per day basis . per log in is not a good one for public traffic because a hacker only has to keep pounding you with login attempts to get a pattern to your security, which is something that I read recently. The hole is this case was blocked. (I refuse to say it was on a Linux site, cos I have mates on there). . and others The key is used on the local machine with the users password to create a, erm, dam dam, I've forgotten the proper word for it, lets call it a ReturnValue (I'm sure I'll remember the word in a minute). From then on, its that ReturnValue that is used to log in the user and identify his traffic (if you intend to go that far, which is wise since if it needs secure users it also needs secure messaging in my book). The imaginary hacker who stole the key has to still know or hack the password, plus has to work out which of the algorithms you used. He has to be carefull incase your key is date/time related so must keep his computer within a timeframe. I'm not saying hacking Crypt's can't be done, but unless too much info is given to potential hackers, its a long time consuming process. What is that word for the returned value? its in my head somewhere..... We do it for the joy of seeing the users struggle.

    C / C++ / MFC debugging database performance question

  • CTreeCtrl Help Please!
    R Rassman

    I suspect that you are trying to GetSelectedItem() actually between the change, there's a point at which none is selected. You wrote the function as getSelectedItem(), are you doing this in java? You, you trator you (only joking man). Anyway, check there is a selection first then with maybe a hit test. We do it for the joy of seeing the users struggle.

    C / C++ / MFC help data-structures question

  • A real challenge . . . customizing programs without the source code
    R Rassman

    Interesting stuff. But creating your own modeless control box would seem to me as the safer option. Otherwise in future upgrades to your off the shelf software you may have to start from scratch. It would only take a change in menu structure or a remodel of the codes modular structure to bugger you up otherwise. We do it for the joy of seeing the users struggle.

    C / C++ / MFC database adobe question

  • CFindFile?
    R Rassman

    Findfile like that is only searching your current directory. (doth it search the PATH too? I can't remember.). But it isn't going to search your entire drive as you would want it to. I use findfile in a self recursive function (it calls itself). Like this, If you don't want the tree just chop those bits out. This is a version that fills a tree with directories. void CExIncView::FillDirTree() { char DRIVES[33]; DWORD DriveNumbers; DWORD j; int k,Image,ImageSelected; CString lString; HTREEITEM ParentList[33]; unsigned lDriveType; m_Messages = " "; UpdateData(FALSE); //For each drive collect all directories DriveNumbers = GetLogicalDrives(); j=1; for(j=1,k=0;k<32;k++,j*=2) { if( DriveNumbers & j ) { DRIVES[k] = 'A' + k; } else { DRIVES[k] = ' '; } } //TEMP Put drives into tree for(k=0;k<32;k++) { if( DRIVES[k] != ' ') { lString.Format("%c:",DRIVES[k]); lDriveType = GetDriveType(lString); switch(lDriveType) { case DRIVE_UNKNOWN ://The drive type cannot be determined. Image = 2; ImageSelected = 3; break; case DRIVE_NO_ROOT_DIR ://The root directory does not exist. Image = 2; ImageSelected = 3; break; case DRIVE_REMOVABLE ://The disk can be removed from the drive. Image = 0; ImageSelected = 1; break; case DRIVE_FIXED ://The disk cannot be removed from the drive. Image = 2; ImageSelected = 3; break; case DRIVE_REMOTE ://The drive is a remote (network) drive. Image = 2; ImageSelected = 3; break; case DRIVE_CDROM ://The drive is a CD-ROM drive. Image = 4; ImageSelected = 5; break; case DRIVE_RAMDISK ://The drive is a RAM disk. Image = 2; ImageSelected = 3; break; default: Image = 2; ImageSelected = 3; break; } //ParentList[k] = m_pDirTree.InsertItem(lString,TVI_ROOT,TVI_SORT); ParentList[k] = m_pDirTree.InsertItem(lString,Image,ImageSelected,TVI_ROOT,TVI_LAST); m_pDirTree.SetItemData( ParentList[k], (DWORD) 50 ); } else { ParentList[k] = NULL; } } //For each parent traverse directory tree for(k=0;k<32;k++) { if(ParentList[k] != NULL) { lString.Format("%c:",DRIVES[k]); SearchDir(lString,ParentList[k]); } } } SearchDir is the self recursive function. void CExIncView::SearchDir(CString sPath) { CString sFind,sTemp; CString sBase,sBase2; int Done; WIN32_FIND_DATA lpFindFileData; HANDLE Search

    C / C++ / MFC question

  • memory leaks
    R Rassman

    Though I go along with the others, specially the likes of bounds checker, I tend to build in a bit of quicky debugging. Afteral, you get told you have memory leaks so all you need to know is 'can my code exit without passing the cleanup' and 'does my clean up clean them all'. Typically a node creation/deletion will follow the same few paths. If none of your memory is freed then that will be pretty obvious to fix, if only some are not freed then it is likely to be a program path problem So, I count them in and count them out in the debug. Then print the debug value. For example, lets say I have something like this below that is part of a xml scema parser. I have global counters, #ifdef TRACE_TREE_MEMLEAKS long m_Count_Tree_Leaks; #endif const int IN_SCHEMA_TREE = 1; const int IN_XML_TREE = 0; void SchemaTree::StoreSingleLineRootItem(LPCTSTR Line, int WhichTree) #ifdef TRACE_TREE_MEMLEAKS //include at every insert point. I had 5 ways into my two trees. ++m_Count_Tree_Leaks; #endif ElementTypeTree* ETType = new ElementTypeTree; CString sLine, lSearchFor; //fill item details if(WhichTree == IN_SCHEMA_TREE) m_DataTree.InsertDataItem(ETType,NULL); else m_XMLTree.InsertDataItem(ETType,NULL); } The multiline element type can create none or many subelements, so I would have these counted in too. void SchemaTree::StoreMultiLineRootItem(int TreeLevel, LPCTSTR ItemString) { static CString RootItemName; ElementTypeTree* ETType; SubElements* subType; CString sLine, lString, lSearchFor; #ifdef TRACE_TREE_MEMLEAKS //include at every insert point. I had 5 ways into my two trees. ++m_Count_Tree_Leaks; ++m_Count_Tree_Sub_Leaks; #endif ETType = new ... subType = new ... Then use #ifdef TRACE_TREE_MEMLEAKS --m_Count_Tree_Leaks; --m_Count_Tree_Sub_Leaks; #endif at each point there are deleted. I put this sort of stuff in from the beginning, it easy then, your not likely to miss one. printing the debug counters values before exit (each possible exit) will tell you you have memory leaks, and which of your structures in is doing it. We do it for the joy of seeing the users struggle.

    C / C++ / MFC debugging performance help question

  • Printing - positioning problem
    R Rassman

    It will be different depending on the selected printer and the resolution selected on it. You size to the printers parameters. Using GetDeviceCaps gives you all you need to calculate your graphic size or text formating. HORZSIZE Width, in millimeters, of the physical screen. VERTSIZE Height, in millimeters, of the physical screen. NUMFONTS Number of device-specific fonts. Use printer matched fonts if possible (though most are good anyway). ASPECTX Relative width of a device pixel used for line drawing. ASPECTY Relative height of a device pixel used for line drawing. ASPECTXY Diagonal width of the device pixel used for line drawing PHYSICALWIDTH For printing devices: the width of the physical page, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical width value of 5100 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller. PHYSICALHEIGHT For printing devices: the height of the physical page, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical height value of 6600 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller. PHYSICALOFFSETX For printing devices: the distance from the left edge of the physical page to the left edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the leftmost 0.25" of paper, has a horizontal physical offset of 150 device units. PHYSICALOFFSETY For printing devices: the distance from the top edge of the physical page to the top edge of the printable area, in device units. For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the topmost 0.5" of paper, has a vertical physical offset of 300 device units If your using the CPrintDialog then LPDEVMODE GetDevMode( ) will get you all the information you want in one go. But the point is, that you must scale to printed page in much the same way as you do for the screen and each of its modes. Experiment with the DEVMODE structure, what you will find is that you can scale text/graphics by the pel size, so that with a function such as (xpos-ypos in mm or points) PrintMyTextOnPaperAndBanLongFunctionNamesToo(xpos,ypos,LPCTSTR Text) You can get accurate printing to 1/10th mm We do it for the joy of seeing the users struggle.

    C / C++ / MFC help tutorial css question

  • CTreeCtrl Help Please!
    R Rassman

    Here's some bits for you. Changed selection void CExIncView::OnSelchangedTree1(NMHDR* pNMHDR, LRESULT* pResult) { TVITEM ThisID; NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; //get itemID. ThisID = pNMTreeView->itemNew; //Some extra bits for you GetTreePath(); SetFileList(); *pResult = 0; } Traverse tree creating a tree path string void CExIncView::GetTreePath() { CString lString; CString sTemp,sTemp2; HTREEITEM lItem; DWORD Code; lItem = m_pDirTree.GetSelectedItem(); sTemp = m_pDirTree.GetItemText(lItem); Code = m_pDirTree.GetItemData(lItem); lString = sTemp; while( (lItem=m_pDirTree.GetParentItem(lItem)) != NULL ) { sTemp = m_pDirTree.GetItemText(lItem); Code = m_pDirTree.GetItemData(lItem); //can make use of the ItemData to trigger different // code branches and pass some bit data sTemp2 = lString; lString.Format("%s\\%s",sTemp, sTemp2); } m_Filename = lString; // UpdateData(FALSE); } Find a string item in my tree. Actually I nearly always keep tree data in a CList or one of its type, seaches in a control with a lot of data can be slow for everyday use. Plus, you can store TV_ITEM objects in your List as items are added so that you can search and then select you tree item very quickly. This first function just shows a way to traverse. It calls a 2nd which finds the item by name Only put this as a quick way to change my Clist search to a tree search const int MAX_ITTERATIONS = 100; void CExIncView::FindInTree(CString &sText) { bool Done = FALSE; int j,Pos; char *lTreeNames[MAX_ITTERATIONS]; CString lString; //split the directory name into individual strings for(j=0;j

    C / C++ / MFC help data-structures question

  • about Linux
    R Rassman

    Dead right there. A typical example was a Developer tool which was close to being like MS developers programming environment, when you first look its brilliant then you find the other half of it, the part that makes it useable, costs two arms one leg and a bag of marbles. I am used to programming in vi editors, and having other windows open for make etc, but it would be so nice if I could do it all in one place. But, in linux's favour I would say that, as with unix, its a very uncluttered environment. Mainly because it doesn't have to come out of the box ready to work in all environments in as automated a way as possible. So, if you do have a mojor number crunching maths modeling job to do, a Linux is great for that. Add Samba and you have an effective NT server so its easy to feed it data, let it chew it a while, then pick up the results. We do it for the joy of seeing the users struggle.

    C / C++ / MFC linux question

  • Upgrade from MS C V7.0 to VC++ 6.0
    R Rassman

    Claudius is right. But all is not lost. For your situation (if you simply want your DOS ap compiled to run in a windows box) I would create a console ap, then add your dos ap files to it (taking care to use the new main()). Depending on what your dos ap does and needs to access, most if not all your code should compile. I did a similar thing a while ago with a dos comms ap and a few of my old maths libs, the only thing I changed was the way it actually captures the port (other direct hardware stuff and Windows will clip your ear and make you stand in the corner). As for any display part of your ap, the Win console actually handles that quite well, fixed fonts etc, line graphics is ok. If you used any of the old graphics lib extensions I'm afraid your compiler or Windows (depending on which parts you used) will tell you where you can stick 'em. The apps/libs I brought to Windows generally had very little to do with the display, but a bit of tidying up sorted some minor screen printing problems, except one. That was with hardcopy printing itself, in my case alignment was based on fixed fonts (I'm a UNIX man ok!, only tthe very young use variable fonts in UNIX). Windows tried to make it prettier with TT fonts, hardly a major thing, unless your ap has to print reems of stuff in a legible way. We do it for the joy of seeing the users struggle.

    C / C++ / MFC c++ question help

  • MDI - Is there an other way ??
    R Rassman

    I never criticise another persons code, afteral. Displaying your code is a bit like displaying your underpants, you never really know if there's a skid mark showing. But, 100 windows in one application?, Lets just say it seemed a good idea at the time and tell the project leader it was only done to test the theory before going on to the release version, ok? If you still want 100 windows, you could have an array of doctemplates, CString sClasssName; for( j=0;j<100;j++) { sClassName = ArrayofClassNames[j]; m_pArrayofTemplates[j] = new CMultiDocTemplate( IDR_MENU, RUNTIME_CLASS(sClassName), RUNTIME_CLASS(CDProg002Frame), RUNTIME_CLASS(sClassName)); AddDocTemplate(m_pProg002Template); } I'm sure you get the gist (sorry have to rush this my German server has just gone awal). But, are you sure you need 100 windows? do you actually need 100 ActiveX windows displaying various information (whatever your app is) which you can create/show/hide/ etc as needed. shit shit even i can't get in my german server. better go sort it. We do it for the joy of seeing the users struggle.

    C / C++ / MFC tutorial question

  • about Linux
    R Rassman

    billions of them. Thats the big thing with Linux, the information you need is spread across a million sites and in an order that the best search engines in the world can't manage. I'm not anti-linux at all, I use it at home and at work, but I sometimes wish a proper professional company would get hold of it and sort it out a bit. Before any Linux gurus write in to give me a hammering, I've been a unix man since 1979 (developer), and linux since it was born, my argument is not with the product but with the the well just about everything else about it. There, I've said my piece. http://www.mandrakesoft.com leads to some discussion groups and tutorials, there are some very good programming tutorials too. Also, don't forget news groups, there's about 20 billion billion of those. I lie not. Not often anyway. We do it for the joy of seeing the users struggle.

    C / C++ / MFC linux question

  • User with Sight Problems / Blind
    R Rassman

    http://www.microsoft.com/enable/ is a good place to start as it leads to many forms of disability discussions. The one I was trying to find for you comes from the Resources collection of manuals, I know its online in the microsoft area somewhere but can not find it at the moment. This document particularly covers the design techniques we programmers should consider in order to make all of our programs as accessible as possible to the disabled using standard Windows accessibility dlls. http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000544 This is close though, the SDK link takes you to the actual resouces that aid in designing in that way. We do it for the joy of seeing the users struggle.

    The Lounge com design help tutorial

  • Another new C based language...
    R Rassman

    When I read the details it twanged one of my memory nodes but failed to quite open the hatch. Though the document page is new (touched today as it happens) I seem to remember the description from another time-frame-continuem. Then I spotted the A T % T, and said to myself I said 'Self', I said 'what?', I said 'do you reccon at&t have got there hands on an out dated compiler for a dime and brushed the dust off to sell it as new, as there have tried before?' I said 'go ask someone else, i'm busy' We do it for the joy of seeing the users struggle.

    The Lounge java com question discussion announcement

  • Starting your own gig... how was it?
    R Rassman

    I don't see any problem with you selling (or sitributing on license) your product whilst still in full time employment, until support and popularity of your product demands more of you. For retail outlets they may prefer demonstations outside daytime hours anyway. I of cause don't know you or your product, but, in my experience as electronics design engineer and programmer, the person who designs the product is generally not the best person to sell it. He/she is the best placed for detailed technical discussions, but that is rarely done at the point (or rather the 'moment') of sale. So, unless it is a situation that requires you as the expert to be present at each installation, I would consider having your product sold/distributed by people who are geared up for it. We do it for the joy of seeing the users struggle.

    The Lounge c++ question

  • EN_CHANGE?
    R Rassman

    OnChange for the control allows you to check per key. It means though that you have to grab the text of the box, check it, then indicate the error to the user. For a box that with a maximum of two characters its fast enough, though it can be equally argued that for a box with two characters checking OnExit or when the return key is pressed is just the same. If your text could be long the OnChange check may be most desirable since the user may need to know before going too far ahead. In this case the first possible method is wastefull, that is, collecting all text and checking it all every time H He Hel Hell Hello Hello W etc For a 256 character line, there is a lot of waste. So, it is better to remember where you have already checked and where the cursor currently is. If you look at CEdit you will find possitional data available to you which you can use for this within the ::OnChange() We do it for the joy of seeing the users struggle.

    C / C++ / MFC question

  • transparent Listbox
    R Rassman

    If your listbox is transparent then you should be telling the parent to repaint in the way that you require. Invalidate the rectangle in the parent where the transparent control is. Though there is another way, rather than have your listbox transparent, which can cause you extra typing because of z order painting problems, pass the background rectangle (on move or resize of the parent) to the child (your control) and stick the background in. Then of cause you are back in a world where the listbox can take care of itself. We do it for the joy of seeing the users struggle.

    C / C++ / MFC question

  • Help...cl.exe hangs on big project
    R Rassman

    Hello Ron. I haven't had this particular problem lately and like you say I can't see it being a resource problem. But, I used to have trouble with an old Windows and to save me going in and out of Windows to run nmake, I split my make file. Then did an Nmake of mafefiles, sort of thing. To get yourself going I would do that very thing again. Though I am a touch worried that you say the problem seems to hinge arround one of three files. I would do a build of those you suspect and at least one before (thinking of the likely order of build) with full warnings switched on , I know you have to plough through junk too with this build, but as you do consider an old type problem, where you used to get a corrupt byte in the source file that confused the compilers. Even notepad is capable of this. Mike. Are you saying that MS have got their cl.exe running at kernal-0 level? I would find that difficult to believe, or maybe your saying that a call it happens to make hi-lights a kernal bug? We do it for the joy of seeing the users struggle.

    C / C++ / MFC json performance help announcement learning

  • Why I can't Open the mdb file correctly?
    R Rassman

    It works better (sharing wise) if you have your tables seperate from the code/views etc. Its also handy to have your queries external. Access's own user login bit has never seemed to quite get the hang of sharing. With a sort of random selection of locking techniques, one record or whole table. This all seems to be ok once your tables are seperated. Another point, which will no doubt cause a scrap amongst us all, is that I tend towards a non Access data type. DBase IV is a favourite, since it can be made accessible from many different language/office apps and you have a wide range of ODBC drivers that your own code can use. (I'll wait behind the bike sheds for the first up) We do it for the joy of seeing the users struggle.

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups