Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6556717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:58:50+00:00 2026-05-25T12:58:50+00:00

I have a .NET 3.5 Compact Framework application that uses MSMQ. We are running

  • 0

I have a .NET 3.5 Compact Framework application that uses MSMQ.
We are running this application on an Intermec CN3, Windows Mobile 5.0 device.

However, when our application first tries to active the MSMQ service with ActivateDevice (pinvoke), the application crashes and we get the error report message:

A problem has occuurred with myApp.exe

Please tell Microsoft about this problem, at not cost to you. ect..

What we have done is this:

  1. Hard Reset the Device
  2. Install NETCFv35.wm.armv4i.cab
  3. Install msmq.arm.CAB
  4. *Run a CF console app that sets up MSMQ and the registry
  5. Soft reset the PDA
  6. *Run our application which calls ActivateDevice() on startup

After doing a soft reset, the first time that ActivateDevice() is called, the application crashes.

However, now that we have called ActivateDevice(), MSMQ services are working on the device atleast until it is soft reset again.

Also, any calls to ActivateDevice() will not crash the application.

The console app that we run after a hard reset is basically this:

class InstallRegister
{
    public void Main()
    {
        RunMsmqAdmin("install");
        RunMsmqAdmin("register install");
        RunMsmqAdmin("register");

        SetQuotaValueRegistry("MachineQuota");
        SetQuotaValueRegistry("DefaultLocalQuota");
        SetQuotaValueRegistry("DefaultQuota");

        RunMsmqAdmin("enable binary");
        RunMsmqAdmin("enable srmp");
        RunMsmqAdmin("start");

        RegFlushKey(0x80000002);
    }

    private void SetQuotaValueRegistry(string quotaValueName)
    {
        Microsoft.Win32.Registry.SetValue(
                "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSMQ\\SimpleClient\\"
                , quotaValueName
                , 100000);
    }

    private void RunMsmqAdmin(string command)
    {
        using (Process _process = new Process())
        {
            _process.StartInfo.FileName = @"\windows\msmqadm.exe";
            _process.StartInfo.Arguments = command;
            _process.StartInfo.UseShellExecute = true;
            _process.Start();
            _process.WaitForExit();
        }
    }
    [System.Runtime.InteropServices.DllImport("CoreDll.dll", EntryPoint = "RegFlushKey", SetLastError = true)]
    private static extern uint RegFlushKey(uint hKey);
}

Our applications call to ActivateDevice() is basically this:

class ActivateMSMQ
{
    public void Active()
    {
        var handle = ActivateDevice("Drivers\\BuiltIn\\MSMQD", 0);
        CloseHandle(handle);
    }
    [System.Runtime.InteropServices.DllImport("CoreDll.dll", SetLastError = true)]
    private static extern IntPtr ActivateDevice(string lpszDevKey, Int32 dwClientInfo);

    [System.Runtime.InteropServices.DllImport("CoreDll.dll", SetLastError = true)]
    private extern static Int32 CloseHandle(IntPtr hProcess);
}

ActivateDevice() still causes our app the crash whenever the device is soft reset.

Has anyone else experienced this with MSMQ on the compact framework?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:58:50+00:00Added an answer on May 25, 2026 at 12:58 pm

    Yes this problem occurs. the quick and easy fix for this is to put the code into a separate executable, then on the start of you app launch this process and wait for completion. The process will terminate due to the crash but will return with your calling app still intact. Then just make sure the executable is deployed in your cab so you app can call it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .Net Compact app running on Windows Mobile, and I want to
I have a .NET Compact Framework app that can runs on three windows machines
I have an ASP.NET MVC 3 (using Entity Framework 4.2) application that uses transactions
I have a simple Windows Form application that is using the .net 3.5 compact
I'm developing a Windows Mobile 5.0 or above application with .Net Compact Framework 2.0
I'm developing a Windows Mobile 5.0 or above application with .Net Compact Framework 2.0
I have an existing VS 2005 Std .NET Compact Framework application that I want
Develop an application on Compact Framework. net 3.5 c# for Windows Mobile 6.x. In
I have a Windows Mobile application that is built for .NET CF 1.0. It
I have a .NET 2.0 application that runs on Compact Framework. It has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.