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
P

Paul Farry

@Paul Farry
About
Posts
71
Topics
46
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Programming standards...no flaming please!
    P Paul Farry

    Christian Graus wrote:

    That's true, but C# and VB.NET are the same tool, except that VB can't do unsafe code. Beyond that, the analogy breaks down, there's no other place where one is the right tool over the other.

    Nice re: the unsafe.. I'd never even looked at that. I meant in the context, of use what you need to given the job at hand. If you do VB use VB, if you do C# use that, but if you have code written one way that works (and it isn't flawed like stated in the message), use whatever you are comfortable with, because they are just tools.

    The Lounge csharp database question

  • Programming standards...no flaming please!
    P Paul Farry

    You can't mix languages in the IDE within 1 project, but you can mix them if you are using commandline compile. The SDK Samples provide an example on how to do this. I find it sad people say I can't do VB, I can't do C#. It's programming. It's the language is a tool. If you are going to dig a hole, you usea shovel, if you are planting a flower in the garden you use a spade. If you are excavating, you use a backhoe.

    The Lounge csharp database question

  • Convert COM component to C++ managed Assembly
    P Paul Farry

    I currently have a COM component (and source) that talks to a printer and also a hardware port through a Vendor supplied DLL that makes fairly low level calls, and was wondering if there is a reference for displaying how to create a Managed Assembly in C++ that can performed the unmanaged calls, but present a nice .Net interface for the other developers. It does lots of GetProcAddress and I would prefer not to interop to my existing COM Component, because I am trying to get a clean project. I could possibly do it in C#, but wondering if it would be better in managed C++? PORTOUT PortOut; PORTWORDOUT PortWordOut; PORTDWORDOUT PortDWordOut; PORTIN PortIn; PORTWORDIN PortWordIn; PORTDWORDIN PortDWordIn; SETPORTBIT SetPortBit; CLRPORTBIT ClrPortBit; NOTPORTBIT NotPortBit; GETPORTBIT GetPortBit; RIGHTPORTSHIFT RightPortShift; LEFTPORTSHIFT LeftPortShift; ISDRIVERINSTALLED IsDriverInstalled; ... and then makes calls like this ... LoadIODLL(); PortOut(0x2E,(unsigned char) 0x87); PortOut(0x2E,(unsigned char) 0x87); PortOut(0x2E,(unsigned char) 0x07); PortOut(0x2F,(unsigned char) 0x07); PortOut(0x2E,(unsigned char) 0xf1); ... hio = LoadLibrary("cashdrawerio.dll"); if (hio == NULL) { return; } else { PortOut = (PORTOUT)GetProcAddress(hio, "PortOut"); PortWordOut = (PORTWORDOUT)GetProcAddress(hio, "PortWordOut"); PortDWordOut = (PORTDWORDOUT)GetProcAddress(hio, "PortDWordOut"); PortIn = (PORTIN)GetProcAddress(hio, "PortIn"); PortWordIn = (PORTWORDIN)GetProcAddress(hio, "PortWordIn"); PortDWordIn = (PORTDWORDIN)GetProcAddress(hio, "PortDWordIn"); SetPortBit = (SETPORTBIT)GetProcAddress(hio, "SetPortBit"); ClrPortBit = (CLRPORTBIT)GetProcAddress(hio, "ClrPortBit"); NotPortBit = (NOTPORTBIT)GetProcAddress(hio, "NotPortBit"); GetPortBit = (GETPORTBIT)GetProcAddress(hio, "GetPortBit"); RightPortShift = (RIGHTPORTSHIFT)GetProcAddress(hio, "RightPortShift"); LeftPortShift = (LEFTPORTSHIFT)GetProcAddress(hio, "LeftPortShift"); IsDriverInstalled = (ISDRIVERINSTALLED)GetProcAddress(hio, "IsDriverInstalled"); }

    Managed C++/CLI csharp com c++ hardware tutorial

  • Viewing the Code
    P Paul Farry

    I'm actually using ProFont which is a conversion from an old Mac font. I believe it's sensational. I run a single 1600x1200 at work and at home, then i can Rdesktop etc to work from home, and none of my settings get messed with. If I'm working on Classes only, i normally make the ToolBox (on the left) autohide, but the solution/class pinned (on the right). If I'm working on Forms, i'll also pinn the Toolbox.

    The Lounge

  • CP Insider as RSS
    P Paul Farry

    CPians, I love CodeProject insider, but I was wondering to any of you prefer to get news via an Aggregator. I love RSSBandit, and I prefer to collect all my information there. Am I in the minority? Should I just get over it? or could we push to have an option of how you receive your CP Insider information? Thoughts.

    The Lounge question discussion announcement

  • Custom deployment
    P Paul Farry

    You could use the Deployment wizard that comes with VB6. If you also wish, you could develop a custom Installer class in VB.net that can perform your custom step, but i'm not sure of the hybrid. You could get WISE/Installshield as well.

    Visual Basic help sysadmin question announcement

  • Horizontal (row) listview
    P Paul Farry

    I'm wondering if anyone has seen a control for .NET either C#, VB.Net that is the equivilent of the Listview that instead of providing rows in the Downward direction, provides the concept of a Row Horizontally. I need to provide a list of things for the user to edit, but I want to provide it across the screen. If i'm just using the listview incorrectly I'd also like to hear about that. If anyone has any suggestions I would greatly appreciate it. Thanks

    Visual Basic csharp

  • Dynamic loaded Assembly attaching PDB file
    P Paul Farry

    I've written a dynamic assembly loading mechanism using Memorystreams, that enables me to "hot" unload an assembly, and load a new version without needing to shutdown my executable. I use Debug versions of my assemblies so that I can get StackTraces out of Exceptions if they occur, which works fine when I use a filebased load of the assembly. Is there some way that I can tell .NET that my PDB files are in a Disk location, and the Assembly has been loaded from a memory stream? BTW: This is using .NET Framework 1.1

    .NET (Core and Framework) csharp dotnet debugging performance question

  • Generation of Strong Names (Best practices??)
    P Paul Farry

    Guys, Just wondering if there are any documents on the generation of strong names for assemblies. Is it the norm to : a) Generate a strong name file for each and every assembly you want to put in the GAC b) Generate a company/personal one(and only 1), and use that against each and every assembly you want to put in the GAC or is there some other method that is employed?

    .NET (Core and Framework) dotnet question

  • Determine Versions required in GAC for a particular Application
    P Paul Farry

    I have an application, that is built using 1.0.1515.12345 of a component in the GAC. I have auxillary programs(dlls) that also depend on the exact same version. I was hoping there was some way to examine the compiled dll (that doesn't load), to find out which version of the GAC based component it is depending on. All I seem to be able to glean at this point is that it won't load. I'm hoping to be a little more helpful to the developers of these Dll's. If I can't then i guess that's life. I found this article on here on Codeproject.Undocumented Fusion[^]

    .NET (Core and Framework) csharp dotnet com announcement

  • Cross Program Serialization
    P Paul Farry

    Hi, I've got 2 programs that share a common class StatusWrapper. This class contains a private class of statusobjects. In program 1 I am creating a socket, and allowing you to connect on a specific port, then request a StatusWrapper information block. In program 2 I connect to the port that program 1 has created, and make the request for the object. Program 1 then serializes this object, and transmits it on the socket to program 2. I cannot get program 2 do deserialize the object as it is reporting an exception that the assembly for program 1 cannot be located. How can I send data like this across to programs? Please help

    .NET (Core and Framework) question json help

  • Remove Lock on (assembly) File
    P Paul Farry

    I have a sub in my VB.Net that is loading a plugin into my Host Application. I have a method in the system that allows a specific plugin to be unloaded. But I cannot get the assembly to allow me to delete/replace the DLL in the system. I've extracted this out to as simple as I can. Am I missing something in this code that would allow me to do it. Imports System.Reflection Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim objDLL As [Assembly] objDLL = [Assembly].LoadFrom("Z:\broker\plugins\EODStoretoXML.dll") objDLL = Nothing System.GC.Collect() System.GC.WaitForPendingFinalizers() System.GC.Collect() end Sub

    .NET (Core and Framework) csharp

  • HI.. anyone had working with DB conection to AS400?
    P Paul Farry

    Hi, On your client access install you should find the OLEDB provider for AS400. This is a much faster library to be using for accessing the AS400, rather than ODBC. I'm currently at home so I don't have the exact connect string. But it's the Provider=IBMDA400 I'll post the proper connection string in the morning, then is also a little trick to setting up the Client Access Install, so that you can pass through your Username/Password in the Connection string rather than having client access popup a Dialog asking for the username etc. CWBCFG or similar to that once again ... in the morning...

    Visual Basic question csharp database

  • Multithread synchronisation in VB.net
    P Paul Farry

    Hi, I'm writing a plugin system in VB.net, and each plugin Implements a base class. (Done). Now I'm making the parent framework that will house and execute each plugin. What I am doing is I will be creating a Thread for each plugin. Then what I want to have is a safe way run the Threads so that if the parent application wants to close, it gracefully closes down the thread before close. Has anyone got any examples of performing something like this?

    .NET (Core and Framework) csharp question

  • Namespace Extension Starting point help please
    P Paul Farry

    Hi, I'm trying to take an old COM component that I have source code to, and convert it to pure ManagedC++. It makes use of Direct API calls, and I can get the core of it working. I'm trying to understand the article written by Nish (Implementing Callback functions using IJW (avoiding DllImport))http://www.codeproject.com/managedcpp/cbwijw.asp[^], but I can't seem to adapt the code correctly. I'm using the RAS api, and as soon as I integrate Nish's code, I get exceptions that new and delete cannot be used. Is there an article or site somewhere that covers creation of namespace extensions (if this is infact the correct term). Any help/pointers would be greatly appreciated.

    Managed C++/CLI c++ asp-net com json help

  • How to Duplicate a Printer
    P Paul Farry

    I've got a situation where I would like to be able to OpenPrinter(...), and then be able to AddPrinter(...) using the configuration from the First printer.. Thereby duplicating the printer (with a different name), but keeping all the configuration on Windows2000. Has anyone done anything like this before, or am I going down a dangerous path?

    C / C++ / MFC tutorial question workspace

  • CopyFileEx notification??
    P Paul Farry

    When I used copyfileex, I'm marshalling an interface for use in the callback. What I want to make sure is that if the user cancels the copy, that I get a notification that (final step e.g.) the Copy has been cancelled coming into the CopyProgressRoutine, so that I can release the necessary interfaces. Am I missing something, or do I not have to marshall the interface for use in the CopyFileEx scenario?

    C / C++ / MFC question announcement

  • ATL collection and event firing
    P Paul Farry

    I've got an ATL component that is used to get a Directory listing async for VB clients. I have 3 interfaces in my Component. IListing IDirectory IFileObject I listing exposes a method of ExecuteImmediate, and Execute(it creates a thread to do the work). It then uses the FindFirstFile/FindFirstFile etc to actually do the work. In this area of the component, I create a CComObject and store that in the member variable for my component. Then the hard work is done, and each CComObject as added to the CDirectory object. All this works perfectly. No leaks, etc. I then call a property (Contents) to return the IDirectory which is my enumeration of the objects. Also fine. If I add to the bottom of the ExecuteImmediate/Execute and Event to Fire_Complete(). The system crashes. I've gone through with the debugger, and I can't find anything. I would really appreciate it if someone could identify any problems with this code(or if I should include some more). DWORD WINAPI SearchFilesFunction2( LPVOID lpParam ) { SearchFunction(lpParam); ExitThread(0); return 0; // thread completed } void SearchFunction( LPVOID lpParam ) { USES_CONVERSION; CListing2* pListing; CComBSTR path; LPTSTR lpsz; BSTR directoryPath; BSTR directoryMask; bool Finished; WIN32_FIND_DATA FileFindData; HANDLE hSearch; pListing = (CListing2*)lpParam; pListing->m_inProgress = TRUE; lpsz = new TCHAR[512]; pListing->get_Directory(&directoryPath); pListing->get_Mask(&directoryMask); path = directoryPath; path += directoryMask; hSearch = FindFirstFile(OLE2CT(path), &FileFindData); Finished = FALSE; if (hSearch == INVALID_HANDLE_VALUE) { Finished= TRUE; } pListing->pDirectory = new CComObject; while (!Finished) { CComBSTR fullpath; BSTR bstr_Filename; CFileObject * pFileObject; pFileObject = new CComObject; _tcscpy( lpsz, FileFindData.cFileName ); bstr_Filename = SysAllocString(lpsz); fullpath = directoryPath; fullpath += bstr_Filename; pFileObject->put_Name(bstr_Filename); pFileObject->put_Path(directoryPath); if (FileFindData.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY)) { pFileObject->put_Type(1); fullpath += "\\"; } else { pFileObject->put_Type(0); } pFileObject->put_Fullpath(fullpath); SysFreeString(bstr_Filename); pListing->pDirectory->Add(pFileObject); if (!FindNextFile(hSearch,

    C / C++ / MFC c++ debugging

  • Using CriticalSections and Components
    P Paul Farry

    Hi have a quick question(hopefully). I've got a multithreaded ATL component for dealing with RAS. I've been told I should put CriticalSections around certain areas of the system. My container application creates 8 instances of the Component and each instance creates 2 child threads. Do I need some form of parent Container to put in a CriticalSection, or do I put the criticalsection in each instances constructor/destructor.

    C / C++ / MFC c++ docker question

  • Determine if System is Shutting Down/Restarting or Logging off
    P Paul Farry

    Is there an API call that can be used to detect if the system is Shutting down/Restarting or Logging Off. I've got a program that runs as a scheduled task, and sometimes when the user logs off, the Program Wait...End Now comes up or the "application couldn't start because the terminal is shutting down", because the scheduled task is started each 5 minutes. I want to prevent the error, is there anything I can do?

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