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
L

Luke Murray

@Luke Murray
About
Posts
68
Topics
30
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Getting reflection permissions with ReflectionPermissionAttribute
    L Luke Murray

    Hey all. I am having a bit of trouble with ReflectionPermissions. I have some code that uses reflection to access properties of classes in a different assembly (also mine). The issue is it only gets the private fields from the top-most object, it does not see the private fields from any of the base objects. I have been trying different things with ReflectionPermissionAttributes with no luck. I think I don't understand how to use it correctly. Anyone got any ideas? Do I have to have the calling code set something or the objects with the private fields? Or the assembly in which they live? On the calling class I have tried things like [ReflectionPermission(SecurityAction.Assert, Flags = ReflectionPermissionFlag.AllFlags, MemberAccess = true, Unrestricted = true)] with no luck. Any help on this would be great. Thank you in advance. Luke

    C# help tutorial question

  • IL DynamicMethod question - Boxing
    L Luke Murray

    Hey all I have dynamic method that get a type passed in. how do I use that param to box the object. So... DynamicMethod dynamnicGet = new DynamicMethod("DynamicGet", typeof(object), new Type[] { typeof(object), typeof(Type) }, typeof(object)); ILGenerator il = dynamnicGet.GetILGenerator(); il.Emit(OpCodes.Ldarg_0); // load the source object onto the stack il.Emit(OpCodes.Callvirt, methodInfo); // call the method il.Emit(OpCodes.Ldarg_1); // load the type onto the stack // Now I want to box it the return type to the param type // Can not use il.Emit(OpCodes.Box, ) because I do not have the type in c#, it is in the IL il.Emit(OpCodes.Ret); // return Hope that makes sense. Any ideas anyone? Thanks, Luke

    C# question csharp dotnet data-structures

  • Biking Again!
    L Luke Murray

    Yes it is cold here. I'm in New York State for business from Australia, very cold. Though a good bike ride would warm me up. Where in New York State are you? The countryside looks nice, but with no car/bike/anything there is not much to do. Luke

    The Lounge visual-studio com

  • Google Ten Golden Rules
    L Luke Murray

    I guess he means http://www.msnbc.msn.com/id/10296177/site/newsweek/[^]

    The Lounge

  • Google Ten Golden Rules
    L Luke Murray

    Where?

    The Lounge

  • Calling Cookie Experts...
    L Luke Murray

    The browser will send the cookie back to any sites that match the domain set for it. when you create a cookie, you can say what domain/level it belongs to. i.e the cookie may below to codeproject.com so the browser will only send it to pages under that no code-project.com. You can also tell the cookie to be sent to any domain or do a sub folder only. So a site like code project would most likely store a hash of you user, password, maybe other things. which it matches against something on the server so the password is not just clearly stored in the cookie. (just guessing here). Each cookie is a key=value pair. Um... they also can have time limits, but again it's up to the browser to discard expired cookies, not you or the site. So really you hope your browser isnt doing anything dodgy. what else. Cookie get sent back to the page in the HTTP header. the page does not have to do anyting with it though. Ad site etc. could use them to track your spending habits. I.e you go the somesite.com they have ads thats are like now when your browser downloads someadserver.com/ad.page?1896287 they can set a cookie and then set the mime type to a jpeg to make the images display. so then next time you go to another site that uses the same adserver that cookie will be sent back, so they can identify you. Then if you ever click on an ad they could store that your 'cookie number' likes computer software, so next time you visit the ad server can display more software ads. Thats my understanding. Hope it helps, I wrote quick so there is most likely holes etc missing. Cheers, Luke

    The Lounge asp-net com sysadmin security question

  • GMail Down?
    L Luke Murray

    Works here

    The Lounge help html com xml json

  • wstring to LPCTSTR
    L Luke Murray

    Thank you guys that worked great. Thanks all

    C / C++ / MFC performance tutorial question

  • wstring to LPCTSTR
    L Luke Murray

    Thanks, that looks like it may help. I'll have a read tonight

    C / C++ / MFC performance tutorial question

  • wstring to LPCTSTR
    L Luke Murray

    Unicode is defined, so the methods are expecting LPCWSTR not LPCSTR and the LPCTSTR is typedef of LPCWSTR. So going from wstring to LPCTSTR with unicode defined should be fine, right?

    C / C++ / MFC performance tutorial question

  • wstring to LPCTSTR
    L Luke Murray

    Hey all. I had a function that simply returned a LPCTSTR like LPCTSTR getSomething() { return L"Hello There"; } Using that in GetClassInfoEx, CreateWindowEx, etc worked fine. Though I tried to change it to a wstring like so wstring getSomething() { return L"Hello There"; } or const wstring getSomething() { return L"Hello There"; } both compiled etc, though I always got memory access errors. I am just wondering why this is so, and what I can do to get around it. Mainly WNDCLASSEX.lpszMenuName = getSomething().c_str() would fall over. Any ideas on how to do this correctlly? I did try casting it as a LPCTSTR as well with no luck. Thanks all

    C / C++ / MFC performance tutorial question

  • Strange unicode rendering problem
    L Luke Murray

    Thanks Johann and James. I look for size calculation errors tonight, I beleive that may be part of the problem. As for memory functions, I am not using them currently (i'll double check though). Thanks

    C / C++ / MFC c++ help

  • Strange unicode rendering problem
    L Luke Murray

    Hey all, I have a little project I am messing around wiht, it just wraps up some winapi functions in c++ classes. I just changed all the std::string's to std::wstring and all my literal string have L"string" now. And UNICODE and _UNICODE are define. Anyway, everything compiles and runs. the only proplem is nothing renders. Buttons do not show and text control do not show, the only thing that shows in the scroolbars for the textarea. Any ideas, I bet it is something simple i am missing. Hope you guy and girls have something to point me to. Cheers

    C / C++ / MFC c++ help

  • changing process access levels/rights
    L Luke Murray

    Thanks for the reply. What I am trying to do is disable the user from killing the app in task manager. first the program enabled SE_SYSTEM_NAME and then open the current process with ACCESS_SYSTEM_ALL (or something, dont have the code infront of me). Then I use GetKernelObjectSecurity to get the Dacl of the process and I adjust that by adding a AddAccessDeniedAce for the PROCESS_TERMINATE mask. and apply that to the Security descriptor and use SetKernelObjectSecurity to set it. Now this work for Windows NT. the task manager gets a 'access denied' when trying to kill the app. But in Win XP the Task manager gives itself the SE_DEBUG_NAME rights and can kill the app. How do I get around this? other programs acheive this, like some firewall apps still return access denied when trying to kill the task in Win XP. I understand using the kill cmd line tool from one of the SDK will always force the app to die. but I want to be able to stop the task manager form end task the app. Any ideas? Thanks Luke

    C / C++ / MFC json

  • changing process access levels/rights
    L Luke Murray

    Cool, what privilege name do you use in LookupPrivilegeValue as I can not find something that seems to disable the right to terminate the process. I had found some things pointing to using Dacl's etc whihc is really annoying, to disable PROCESS_TERMINATE. Thanks

    C / C++ / MFC json

  • How to receive SB_THUMBPOSITION
    L Luke Murray

    My bad, the wheel does fire the WM_VSCROLL through WM_NOTIFY. it did ever trigger the SB_ENDSCROLL which I was also testing for.

    C / C++ / MFC tutorial question

  • How to receive SB_THUMBPOSITION
    L Luke Murray

    Well, I got it. If you add ENM_SCROLLEVENTS to the event mask, you will get the messages through WM_NOTIFY. Then the lParam is a pointer to a MSGFILTER stucture, which gives us the message code of original message, in this case WM_VSCROLL, and LOWORD(msgFilter->wparam) is the SB_* N ow this is great. Only problem now is the mouse wheel does not fire this event, but it did fire the EN_VSCROLL through WM_COMMAND. annoying. Thanks all

    C / C++ / MFC tutorial question

  • How to receive SB_THUMBPOSITION
    L Luke Murray

    The problem is WM_VSCROLL etc get sent to the richedit control, not my dialog. the winproc in my dialog I have to catch WM_COMMAND and in that wparam is EN_VSCROLL, and the lparam is the richedit handle, so I lose the SB_THUMBPOSITION and SB_BOTTOM etc. If i subclassed the richedit and had a winproc for that i could get the WM_VSCROLL messages. but I did not want to sub class the richedit. Thanks anyway Luke

    C / C++ / MFC tutorial question

  • How to receive SB_THUMBPOSITION
    L Luke Murray

    Yeah, that was something I hoped to avoid. I really would have thought there would be a way.

    C / C++ / MFC tutorial question

  • How to receive SB_THUMBPOSITION
    L Luke Murray

    Sorry that is meant to be hrichEdit, like SendMessage(hrichEdit, EM_SETEVENTMASK, NULL, LPARAM(SendMessage(hrichEdit, EM_GETEVENTMASK, 0, 0) | ENM_SCROLL )); From what I have read. if you have a winproc for a window you can catch WM_VSCROLL and LOWORD(lParam) will be SB_THUMBPOSITION. the issue I have it when its a scroll message from a child window (like in this case) first you catch WM_COMMAND then EN_VSCROLL through HIWORD(wParam) and lParam in this case is the handle to the richedit control. So i'm not sure how to get the message for SB_THUMBPOSITION from the child window. I guess I have to have a winproc for the richedit control and handle it through the WM_VSCROLL etc? Then i'm not too sure on how to do that. The dialog is loaded from a resource file as well. Cheers, Luke

    C / C++ / MFC tutorial 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