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
M

Malcolm McMahon

@Malcolm McMahon
About
Posts
58
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Crypting passwords
    M Malcolm McMahon

    A google search turned up: The MD5 Homepage

    C / C++ / MFC windows-admin tutorial question

  • Java swing with IE?
    M Malcolm McMahon

    I'd like to use swing in an applet too, and I don't think I can use the sun java plugin because of the way this applet interacts with other elements of the Windows system. Microsoft, predicatably, has it's own user interface routines called AFC which are in com.ms.ui.*. The problem is that I can find no on-line documentation for them. J++ displays the bare class structures for me and I've been using trial and error and a few examples I've turned up but it looks like I'm going to have to buy a book. They do provide stuff like multi-column scrolling lists, trees etc. and in a microsoft-looking format. Of coursre this probably means you'll have to do it all again if you want a version of the applet to run anywhere but IE.

    Java help question java discussion

  • JFrame client area
    M Malcolm McMahon

    I don't think a container has a size or position at this point.

    Java question

  • Crypting passwords
    M Malcolm McMahon

    Generally password encryption is done with a "trapdoor" algorithm, i.e. you can't decrypt. You record the encrypted password then, when someone tries to log in or whatever, the password they enter in encrypted through the same algorithm and the encrypted versions compared. This kind of encrypted version is often called a "digest".

    C / C++ / MFC windows-admin tutorial question

  • Gray Box Where Applet Should Be
    M Malcolm McMahon

    Try getting the java console up on IE6. You need to enable it on the advanced options window, restart IE, and click on it on the view window. This will give you a crude java backtrace if any exceptions occur, and will tell you about any missing classes etc..

    Java java help tutorial learning

  • calling a C-dll function from java code
    M Malcolm McMahon

    That doesn't look like it would allow you to access an existing DLL though. Only one specially written for this purpose. Of course you could write an interface from there to a standard DLL.

    Java java help question

  • How can i add some text boxes on same form
    M Malcolm McMahon

    The method of making radical changes in screen contents from javascript (Called Dynamic HTML) is basically to overwrite a chunk of the HTML. But you generally need to replace the whole contents of a particular tag. So you might rewrite the hmtl for your whole form. You do this by setting the "innerHTML" property of the element you're changing the contents of to a string value containing the new HTML code. You can, of course, put in tags just for this purpose, typically I use tags with IDs. If you just have some fields that are only shown sometimes it's generally easier to just mark them hidden in the HTML and use the javascript to change their style.visibility property to vissible.

    Java javascript question

  • Exlusive-or crypting
    M Malcolm McMahon

    Exclusive or is the binary equivalent of the old "chinese addition" used by the spies of old, which involves adding digits but ignoring any "carry" numbers. So you'd get (with the decimal version) 29232 + 56299 = 75421 the binary version would go like: 1011110 xor 0111010 = 1100101 It allows your data to be combined with a random stream of numbers so that it can be easilly retrieved by someone who has the same random stream of numbers. The convenience is that if you xor twice with the same data you get back to the original. This, of course, is the easy bit. The hard part is to ensure that the sender and the intended recipient have the same encoding stream and the bad guys don't. In the old days the spies had "one time pads", basically pages of random numbers which they had to smuggle physically and which they were supposed to destroy after use. These days we tend to generate pseudo-random sequences from seed codes like pass phrases.

    C / C++ / MFC question

  • calling a C-dll function from java code
    M Malcolm McMahon

    There are facilities for this kind of thing in the MS version of the java engine. It's documented on the microsoft java site. Basically microsoft have put in some naughty java extensions for this purpose. You do things like /** @dll.import("USER32") */ static native int MessageBox(int hwndOwner, String text, String title, int style); (This must be in a class definition, of course). I rather doubt there are any facilities to do this kind of thing in the Sun java engine. It's too machine dependant.

    Java java help question

  • Java User Inferace from IE Applet
    M Malcolm McMahon

    I'm trying to set up a fairly sophisticated user interface from an applet running under Internet Explorer 5+ (without the java plugin). javax.swing.* appears to be unavailable so I've been working with com.ms.ui.* Trouble is I've found no documentation for these classes beyond the bare definitions I get from J++ and few examples. I'm working largely by trial and error. I'd like to put a file and directory selection window on the applet form (rather than using the FileDialog). (Yes, it's a signed applet). Has anyone located any documentation for this stuff? This is an extremely frustrating way to work.

    Java design java com help question

  • How do you set the size and location of a JButton in an applet?
    M Malcolm McMahon

    Objects in a window are sized dynamically by the layout manager. If you don't specify a particular layout manager the default one is FlowLayout. The layout manager asks the component for it's preffered size, then usually sets it's size to that (if it finds enough space). If you really need to take control over an component's size they you probably need to subclass the component and override the getMinimumSize and getPreferredSize methods.

    Java question

  • XSL Transformation
    M Malcolm McMahon

    Actually this isn't valid XML. No closing of the TAGNAME tags. I'm affraid what you are trying to do may not be possible in a general case :(( . If the A values are from a known set you can probably do it, by doing an xsl:if and a xsl:foreach for each possible value <xls:if select="TAGNAME[@x='1']"> <xsl:foreach select="TAGNAME[@1='1']"> ... The absence of genuinely variable variables in XSL otherwise rather screws you up.

    Web Development xml tutorial question

  • Inserting plug-ins from web page
    M Malcolm McMahon

    I'm wanting to provide a plug in from a web page. This is for the benefit of users who download files from the site which are PGP encrypted. The plug in needs to find their PGP stuff and decrypt incoming files fairly transparently. The initial web page should check to see if the plug-in is in place and, if not, offer to install it. These customers are required to use IE5 5 or above. Their PC setup is, I gather, fairly requlated. I suspect the appropriate kind of plug in is a mime type filter whick IE5 seems to support. I can see, in outline, what's needed and I've come accross tantalising scraps of information on MSDN but I really need some kind of overall guide to working this trick. I guess the approach will work through a java Applet which then asks for permission to access local files, intalls a DLL into the PLUGINS directory and then registers it, somehow with the system and with IE.

    Web Development java tutorial workspace

  • Dynamic Multidimensional Array or Alternatives
    M Malcolm McMahon

    There are all sorts of structures, depending on what you're storing and how the "dynamic" bit occurs. Often you'll want to create a class for each dimension. Along the lines of class Cell { .. whatever each cell stores }; class Row { .. .. .. Cell &operator[](const int idx); } class Matrix { .. .. Row &operator[](const int idx); }; Then you can do: Matrix mat(...); Cell v1,v2; mat[row][column] = v1; v2 = mat[row][col]; How the data are to be organised within the Matrix and Row classes depends on how it's used. Is it sparse? Does it grow and shrink? Are new elements added in the middle or only appended? You can use one of the standard collection classes within your classes, or you can brew your own list or array structure. You may also want to add a exception for index out of range.

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

  • simple question about "static"
    M Malcolm McMahon

    Actually memory for the array isn't allocated at all since the class is never instanciated. But the forward reference for the value of s does make it impossible for the compiler to lay out the class structure fully until the reference is satisfied. It's just being a lazy compiler.

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

  • HOW DO I DO IT ????
    M Malcolm McMahon

    This board accepts html tags in your posting. To include blocks of code you can use <PRE> or <CODE> If I put in <PRE> Some text </PRE> I get:

    Some Text

    <CODE> Produces text Like This (To make actual HTML appear as text you use "<" in place of "<")

    C / C++ / MFC question sysadmin tutorial

  • WSAAsyncselect winsock problem
    M Malcolm McMahon

    The top half of the long value in the window message (from memory) contains the FD_ flags for the event(s) that trigger the message. In general, however, I use AsyncSelect like this:

    1. I make a winsock call.
    2. If the call returns the WOULDBLOCK result I wait for AsyncSelect to send a message.
    3. I make the same call again. This time I should get a real result (should I get a WOULDBLOCK I'll wait again).

    When I get these messages I generally just look for an error code , or a FD_CLOSE. Otherwise I check the status by making the winsock calls. So, for example, you do a listen. You call accept and it will normally give you a WOULDBLOCK (if it doesn't it means a call is already waiting and you can take it). Then you wait for a message from asynselect to tell you there's a connection waiting. Then you make that accept call again and it gives you the new socket. The only exception to this pattern is the connect call which you only make once. In the case of the connect call once your FD_CONNECT comes back you're connected. You don't make the connect call again (an annoying inconsistency to my mind).

    C / C++ / MFC question help

  • Tooltips and Trees
    M Malcolm McMahon

    Thanks, that's probably it. I may well be looking at too generic a message too. I'll give it a go tonight.

    C / C++ / MFC data-structures tutorial

  • Tooltips and Trees
    M Malcolm McMahon

    Yup, I think that's the structure (this would be a lot easier if I had the code here). The structure I get contains a window handle and a what is probably a controll id. But what I need to access the data and supply the text is the HTREEITEM handle, which just doesn't seem to be arround. Nor can I find anything in CTreeCtrl that seems intended to look it up.

    C / C++ / MFC data-structures tutorial

  • Tooltips and Trees
    M Malcolm McMahon

    I think that's the message I handle (don't have the code with me here). Certainly the routine I put in get's called when I'd expect it to, I just don't know how to make sense of the parameters.

    C / C++ / MFC data-structures tutorial
  • Login

  • Don't have an account? Register

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