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
2

2bee

@2bee
About
Posts
55
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to catch a security exception within Remoting.Config(...)
    2 2bee

    Ennis Ray Lynch, Jr. wrote:

    I don't know if that is it or not <

    Nope, that is quite alright. As i said, there is nothing wrong neihter with the program nor with its configuration. I just need to know how i could catch a security exception that is raised during the remoting configuration. I mean my entire application works perfect, unless i specify a group that doesn't exist. It is quite logic that the remoting configuration fails when i specify a nonexistent group but why is it impossible to catch this security exception? Anyway, thanks for your efforts. Tobias

    C# security tutorial question

  • How to catch a security exception within Remoting.Config(...)
    2 2bee

    hi, Hmm, i did this a thousand times but it doesn't point specifically to my application! Obviously RemotingConfiguration.Configure is running in a different thread but how to catch the exception in it? e voila: Unbehandelte Ausnahme: System.Security.Principal.IdentityNotMappedException: Man che oder alle Identitätsverweise konnten nicht übersetzt werden. bei System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) bei System.Security.Principal.NTAccount.Translate(Type targetType) bei System.Runtime.Remoting.Channels.Ipc.IpcServerChannel.Listen() bei System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart() Further, this exception says that the system was unable to resolve the specified account. However i am fully aware of that and did intenionally use a wrong group. I just want to know how to catch this security exception that is raised by the CLR. regards Tobias

    C# security tutorial question

  • How to catch a security exception within Remoting.Config(...)
    2 2bee

    Hello, well, i have been checking this over and over again, but i am still unable to catch this exception: System.Security.Principal.IdentityNotMappedException. This exception is thrown when i use an incorrect authorizedGroup attribute within my application config. Surely it's right that i get an exception when i specify a group that doesn't exist but at least i should be able to catch it, shouldnt i?

    try
    {
    
      RemotingConfiguration.Configure(".\\MyApp.exe.config", false);
    
    }
    catch (Exception)
    {}
     
     
    app.config
     
    <channels>
      <channel ref="ipc" portName="MyAppPort" authorizedGroup="IIS_WPG">
        <serverProviders>
          <
    

    However i assume that i can't catch this excpetion because RemotingConfiguration is running in another (application?)context. Furthermore my application is doing fine. The only thing that bothers me is that cannot catch this exception when a nonexistent group is specified. If someone has an idea how to catch this exception, then please let me know. I would really really appreciate it. best regards Tobias :-D

    C# security tutorial question

  • problem Facing with c++/cli arrays
    2 2bee

    Hi, if want to directly initialize your array then you'll have to do it like this:

    array<String^,2>^ strarr = gcnew array<String^,2>{{"focus1","focus2"},{"focus3","focus4"}};
    Console::WriteLine("{0}",strarr[0,0]);
    

    In additon I would recommend you to read this article. http://www.codeproject.com/managedcpp/cppcliarrays.asp[^] best regards Tobias

    Managed C++/CLI help c++ data-structures

  • Multidimension arrays
    2 2bee

    Hello, you might want to read this article as well http://www.codeproject.com/managedcpp/cppcliarrays.asp[^] Best regards Tobias ;)

    Managed C++/CLI tutorial question data-structures performance help

  • How to Create Array of Labels on the Run-Time ?
    2 2bee

    Hi, you forgot to add the label to the form. private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { array^ myLabelArray = gcnew array(10); myLabelArray[0] = gcnew Label(); myLabelArray[0]->AutoSize = true; myLabelArray[0]->Location = System::Drawing::Point(100, 10); myLabelArray[0]->Name = L"lblX"; myLabelArray[0]->Size = System::Drawing::Size(63, 13); myLabelArray[0]->Text = "HELLO"; myLabelArray[0]->TabIndex = 50; myLabelArray[0]->Visible = true; this->Controls->Add(myLabelArray[0]); } }; regards Tobias

    Managed C++/CLI data-structures tutorial question

  • Conver Data Type Problem
    2 2bee

    Hi, Int32 is a value class, you probably used ^ there. Int32 Bet; // should be fine regards Tobias

    Managed C++/CLI help

  • How to Create Array of Labels on the Run-Time ?
    2 2bee

    Hi, maybe my first statement lead you in the wrong direction. array^ myLabelArray = gcnew array(10); This line just creates an array with 10 references of the type Label. A reference type is implicitly initialized with a nullptr, thus myLabelArray[0]->Location = Point(100,100); will not work unless you initialize it first. // will work lab[0] = gcnew Label(); lab[0]->Location = Point(10,10); You should also use try-catch to catch exceptions that possibly occur. regards Tobias

    Managed C++/CLI data-structures tutorial question

  • How to Create Array of Labels on the Run-Time ?
    2 2bee

    Sorry my fault, my thoughts were faster than my fingers: (I forgot the '^' hat operator which classifies myLabelArray as a reference type) array^ myLabelArray = gcnew array(10); Tobias

    Managed C++/CLI data-structures tutorial question

  • How to Create Array of Labels on the Run-Time ?
    2 2bee

    Hello, if you mean with "Label" a System::Windows::Forms::Label control then you could use this snippet: // an array of 10 Labels array myLabelArray = gcnew array(10); regards Tobias

    Managed C++/CLI data-structures tutorial question

  • Loading Resource
    2 2bee

    Hello, i found this article quite useful and it could help you in solving your issue. However this article shows how to create resources (bitmaps etc.) and use them within a .Net program. I am not quite sure if this is actually what you want. :confused: Furthermore it is written in C# but on the other side, C# is easy to convert to C++/CLI. http://www.jelovic.com/articles/resources_in_visual_studio.htm[^] so it would be instead:

    ResourceManager^ resourceManager = gcnew ResourceManager("MyCompany.MyProject.SomeResources", GetType().Assembly);
    Bitmap^ image = (Bitmap^)resourceManager->GetObject ("MyBitmapName");

    Hope this helps, best regards Tobias

    Managed C++/CLI csharp c++ graphics testing beta-testing

  • Threading
    2 2bee

    I have just browsed the msdn[^]...

    using namespace System;
    using namespace System::Threading;
    ref class Work
    {
    public:
       Work(){}
    
       void DoWork(){}
    
    };
    
    int main()
    {
       Work^ threadWork = gcnew Work;
       Thread^ newThread = gcnew Thread( gcnew ThreadStart( threadWork, &Work::DoWork ) );
       newThread->Start();
    }
    
    Managed C++/CLI tutorial

  • Open file using IE [VC++ 2005]
    2 2bee

    Hello, my solution might be a little odd, but it actually works. System::Diagnostics::Process^ myProcess = gcnew System::Diagnostics::Process(); myProcess->Start("iexplore.exe","C:\\index.html"); If you're using .Net 2 then you could also use the new System::Windows::Forms::WebBrowser class, to embed a webbrowser into your application. regards Tobias

    Managed C++/CLI c++ help

  • Running an executable through C++.Net code
    2 2bee

    Hi, that is really strange, because i got it working with those two lines: System::Diagnostics::Process^ myProcess = gcnew System::Diagnostics::Process(); myProcess->Start("iexplore.exe"); Further i believe that std::System(...) is from the Standard C++ Library, though it is not .Net. However, as long as it works I wouldn't bother at all. regards Tobias

    Managed C++/CLI csharp c++

  • Running an executable through C++.Net code
    2 2bee

    Hello, you might succeed with System::Diagnostics::Process::Start( " c:\\test.exe" ); But I haven't checked it by myself yet! regards Tobias

    Managed C++/CLI csharp c++

  • Threading [modified]
    2 2bee

    Hi, as far as i know it should be done like this in C++/CLI: System::Threading::Thread^ backgroundThread = gcnew System::Threading::Thread (gcnew System::Threading::ThreadStart(this, &TCPIP::SocketConnection)); The "this" pointer is not neccessarily needed but if you pass a nullptr instead, then you'll have to specify a static method. regards Tobias

    Managed C++/CLI help

  • How do I Convert Struct to ByteArray in .net 2005
    2 2bee

    Hello, you might want to give the BinaryFormatter class a try. It allows you to serialize and deserialize objects to and from a stream. As far as i know you could then retrieve the buffer from it or even write the stream to the serial port. You will find it in this namespace: System::Runtime::Serialization::Formatters::Binary; Anyway, I cannot guarantee that it will actually work, because i haven't had the time yet to test it by my own. Best regards Tobias

    Managed C++/CLI csharp data-structures help question

  • adding dll
    2 2bee

    Hi, i guess you were talking about a managed c++ dll and you would like to add it to a clr project in VS2005. If so, then you'll have to do the following: 1. go to "Project->References", click on "Add Reference" 2. Browse to your dll and add it 3. reference the namespace of your dll e.g. using namespace MyDllNamespace; using namespace MyDllNamespace::Net; ... regards Tobias :cool:

    Managed C++/CLI question

  • Using serial ports in vs on xp
    2 2bee

    Right, maybe it did sound a little negative. The reason for my statement was that my application really depends on a very accurate switching time between Request to Send enabled/disabled. For some reason this switching time differs for each switch, 5-15 ms while using the .Net class. Thus I need a constant switching time, which must be less than 10 ms, i'll sometimes run into trouble. With the windows.h method I have never discovered this problem. It displays all the time a continuous 5 ms switch time on my oscilloscope. Probably there is a way to close out this problem but by the time I faced this problem, it was quite critical to go ahead with my project. Therefore I decided to go for the unmanaged option for the time being. However apart from this odd behaviour this new class is quite comfortable and very straight forward. I'll maybe give it another try after finishing my project. best regards Tobias

    Managed C++/CLI c++ visual-studio com tutorial question

  • Using serial ports in vs on xp
    2 2bee

    Hi, if you are using .Net 2 then System::IO::Ports::SerialPort should be the way to go. However, i found this new serial port class quite unreliable (in terms of switching RTS) and used therefore recently the one from windows.h. for example: HANDLE _ComPort = CreateFile( ptrComName,....); // create a port and use WriteFile(_ComPort, ptrTxFrame, pTxFrameLength,&ulBytesWritten, 0); ReadFile(_ComPort, ptrRxFrame, 256, &ulBytesWritten, NULL); to read and write, but with this approach you'll always have to pinpoint your buffers. pin_ptr ptrTxFrame = &pTxFrame[0]; best regards Tobias

    Managed C++/CLI c++ visual-studio com 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