Quantcast
Channel: General Windows Desktop Development Issues forum
Viewing all 6180 articles
Browse latest View live

Data encryption with public key and decryption with private one

$
0
0

I'm trying to write a simple application capable of -cryption described in the topic. Final target is to write an application that encrypts data with public key on the "source" side and decrypts that data with private key (stored at smart-card) on the "destination" side, but it's a subject for later discussion.

So, there are:

 • asymmetric key residing on smart-card (its private part is unavailable for extraction and stealing);

 • the "source" side which performs data encryption with public key;

 • the "destination" side which performs data decryption with private key from SC.

I'm stuck with a moment of encryption with public key. Steps I've performed are the following:

0) acquire context to container with preliminarily generated key pair (in my sample this key pair will be exported from "source" and imported to "destination", thus emulating work with SC);

1) get a handle to that key with CryptGetUserKey;

2) generate a session key for encryption (of course, I won't encrypt large amount of data with asymmetric key because you-know-why :));

3) … and I don't know how to encrypt data with public key.

CryptEncrypt and CryptEncryptMessage don't seem to have a parameter controlling which part of a key will be used for encryption (AFAIK they use public part), and CryptProtectData is used only for local encryption. Nevertheless, MSDN documentation and some other sources says that data CAN be encrypted with public key.

Reading the whole documentation on this didn't make situation clear for me, and I still can't understand how to do this. How should it be done?

Thanks in advance!


If I fall I will arise on my way to paradise


Searching for phrases in Windows 7 file explorer doesnt work

$
0
0

I can search for phrases only for words using the search box. AQS doesnt help it seems.  

I am using Windows 7 Enterprise at work with SP1.  I have recreated the problem using a directory called "test".  I have two files called doc1.docx and doc2.docx.  The first contains:

Yield to worst blah blah blah

The second contains:

Yield the worst blah blah blah to

If Search box = yield to

then I get both doc1 and doc2 returned.  So it doesnt matter that the two words are meant to be contiguous separated by a space.  The searh is simply returning all documents that contain both yield and to in with any text in between rather than the space that I put in the Search box.

What I wanted returned was just doc1, as this contains "yield to" (ignoring quotes).  So how to I search for specific phrases, ie two or more words separated by spaces please?

Rupert

Datagridview and combo box column

$
0
0

I have a datagridview and 2 combo boxs. The dgv will have 3500 rows. When I try to populate the s(about 20 entries each). It takes forever to load the form. Here is what I have:

 For Each dr As DataRow In dt.Rows
                    Dim grdRow As DataGridViewRow = New DataGridViewRow
                    grdRow.CreateCells(grdSettings)
                    grdRow.Cells(0).Value = dr.Item("ITEM").ToString
                    grdRow.Cells(1).Value = dr.Item("FAMILY_GROUP").ToString
                    grdRow.Cells(2).Value = dr.Item("HARDWARE").ToString
                    grdRow.Cells(3).Value = dr.Item("MODELID").ToString

                    'populate the combo boxes
                    AssemblyLine.DataSource = dtASYLines
                    AssemblyLine.DisplayMember = "DESCRIPTION"
                    AssemblyLine.ValueMember = "LINE_ID"

                    SMTLine.DataSource = dtSMTLines
                    SMTLine.DisplayMember = "DESCRIPTION"
                    SMTLine.ValueMember = "LINE_ID"

                    grdSettings.Rows.Add(grdRow)
                    grdSettings.Height += grdRow.Height
                Next
each datatable (dt) has the data for each combo and the rest of the grid. Any help is greatly appreciated.


*** Please allow me to mark threads as answered and I will, Thank you ***

How to setup access rights for dll development, debugging and testing?

$
0
0

I want to develop a desktop application on my computer. The computer runs under Windows 10 home edition. I use my user account which is an administrator account. The development environment is VS 2015. The application is an executable with a few dlls. My problem is registering the dlls with regsvr32 and debugging the application.

Just calling regsvr32 on the dll gives an access right error. So I run regsvr32 as administrator. But then I can't debug the application using VS because VS needs to run as administrator. Then running VS as administrator also has all sort of other issues with other system files, modules and applications.

So for now, I do this development on the "administrator" account and all go well.

But I don't particularly feel safe doing the development on the administrator account. I would prefer to use my regular user account for that.

I searched the web but haven't found a suitable solution for this. I found partial solutions like running the regsvr32 as administrator to avoid the access right error message but no complete development solution.

Can anyone offer a solution for the whole development process ?

Service won't start on Windows 10 Only!

$
0
0

Hi guys,

this is a strange issue only with Windows 10.

A windows service developed for testing in vb.net  doesn’t start under Windows 10 at boot time when set to Automatic start.

The point is, this service does almost nothing – it’s just a pure pretty empty test code.

When start manually it takes less than 100ms.

When started on boot, there are two error entries within the event Viewer:

  1. Source: Service Control Manager – Event ID: 7009 (A timeout was reached (30000 milliseconds) while waiting for the EVPTestService service to connect.)
  2. Source: Service Control Manager – Event ID: 7000 (The EVPTestService service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.)

Now, started manually, again this only takes  around 100ms.

Dev Tool: VS 2010 Prof. SP1

Compiler: set to ANY CODE

Framework:  .NET 3.5

Windows 10 Enterprise: Version 1511 Build 10586. 104

The code is not signed

Here is the entire own test code:

Imports System.Threading

Imports System.IO

PublicClassEVPTestService

   Shared OnStartEntered AsDateTime

   Shared ThreadCreated AsDateTime

   ProtectedOverridesSub OnStart(ByVal args()AsString)

       OnStartEntered = Date.UtcNow

       Dim Starter AsNewThread(AddressOf StarterJob)

       ThreadCreated = Date.UtcNow

       Starter.Start()

   EndSub

   PrivateSub StarterJob()

       Try

           Dim JobEntered AsDateTime = Date.UtcNow

           Using sw AsStreamWriter = NewStreamWriter("c:\service_test_file.txt",True)

               sw.WriteLine("-------------------------------------------------------------")

               sw.WriteLine("Service Code Entered: {0} ", myServiceEnteredTimeStamp.ToLocalTime.ToString("MM/dd/yyyy HH:mm:ss.fff tt"))

               Dim diff1AsTimeSpan = OnStartEntered.Subtract(myServiceEnteredTimeStamp)

               sw.WriteLine("OnStart Entered after: {0} ms ({1} seconds)", diff1.TotalMilliseconds.ToString, diff1.TotalSeconds.ToString)

               sw.WriteLine("Thread created after: {0} ms", ThreadCreated.Subtract(OnStartEntered).TotalMilliseconds.ToString)

               sw.WriteLine("JOB entered after:    {0} ms", JobEntered.Subtract(ThreadCreated).TotalMilliseconds.ToString)

               Dim diff2 AsTimeSpan = Now.Subtract(myServiceEnteredTimeStamp.ToLocalTime)

               sw.WriteLine("Done! Total Duration: {0} ms ({1} seconds)", diff2.TotalMilliseconds.ToString, diff2.TotalSeconds.ToString)

               sw.Flush()

               sw.Close()

           EndUsing

       Catch ex AsException

       EndTry

   EndSub

   

EndClass

After hundreds of test the fact is that this code works without any problems under Windows XP, Vista, 7, Windows 8.1. It just doesn’t work in Windows 10!!!

After it always failed in Windows 10, I’ve added the Registry Key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ ServicesPipeTimeout with a value of 12000

Then the service started correctly.  I deleted the registry key again and changed the start mode from Automatic to Automatic (Delayed) – and it also started correctly. BUT, these aren’t acceptable options for our customers production systems - PLEASE KEEP THIS IN MIND!!!. So the questions is, why does this service time out under Windows 10, but works in all other windows versions ???

Here is the file the service produced when it started:

-------------------------------------------------------------

Service Code Entered:  02.12.2016 21:48:27.099 

OnStart Entered after: 4577.938 ms (4.6 seconds)

Thread created after:  93.4824 ms

JOB entered after:     1250.1962 ms

Done! Total Duration:  6421.6304 ms (6.4 seconds)

I was checking the boot log (procmon)  - see the results in the screenshot:

Procmon boot

So I guess the key question is: why does this dll take so long to load  !on Windows 10 only! and how can this be optimized?

This is a serious issue as more and more customers evaluate Windows 10 - and so I really hope some Win 10 expert from Microsoft will take this serious and give us an idea about this problem.

Thanks!





Transitioning from XP (32 bit) machine to W7 (64bit) machine

$
0
0

On both of the subject systems, I'm using 'Express' versions of Microsoft VB.Net compilers.
I was initially encouraged after I compiled and ran several of my old XP system apps (small in size) on the W7 system.
They ran fine in Debug as well as Native modes.  Then I tried my largest app (892 Kb).
When I corrected the usual reference errors and (thought) I had a clean compile I tried to run it in Debug mode and
crashed.  The exception information is pasted below - followed by the identification info for both systems compilers.

More tidbits about the situation -

1) The W7 compiled app ran fine when I copied the .exe file over to the XP machine and executed it.

2) A web forum suggested that my W7 compiler build configuration should be using "x86" rather than using:
"Platform: Active (Any CPU)" - However, this can't be changed to "x86" in my "Express" version, so I did what some have suggested:

I directly edited the .vproj file to force specification of x86 platform cpu (The fact that I did this edit is mentioned twice in the exception information).

I'll close for now - I'm sorry, but I pressed the wrong key recently, and a gibberish code block appeared in my post.  Please ignore it if you can.


System.InvalidOperationException was unhandled
  Message=An error occurred creating the form. See Exception.InnerException for details.  
The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

No Source Available
No symbols are loaded for any call stack frame.  The source code cannot be displayed.

Another window was opened titled "InvalidOperationException was handled"
 
Exception information:
Source=W0ECSLoggerSpotter2
  StackTrace:
       at Project1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
       at Project1.My.MyProject.MyForms.get_form1()
       at Project1.form1.Main() in C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET683 Logger X86 direct edit of vproj file\Form1NEW.Designer.vb:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.InteropServices.COMException
       Message=Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
       Source=System.Windows.Forms
       ErrorCode=-2147221164
       StackTrace:
            at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
            at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
            at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
            at System.Windows.Forms.AxHost.CreateInstance()
            at System.Windows.Forms.AxHost.GetOcxCreate()
            at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
            at System.Windows.Forms.AxHost.CreateHandle()
            at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
            at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
            at System.Windows.Forms.AxHost.EndInit()
            at Project1.form1.InitializeComponent() in C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET683 Logger X86 direct edit of vproj file\Form1NEW.Designer.vb:line 3331
            at Project1.form1..ctor() in C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET683 Logger X86 direct edit of vproj file\Form1NEW.Designer.vb:line 6
       InnerException:

On the old XP system, I'm using:

Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel

On the new W7 system, I'm using:

Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.0.30319 SP1Rel

Installed Version: VB Express

Thanks, I hope this leads to a productive discourse and a solution to my problem.

ftbrady


ftbrady

ReadProcessMemory and WriteProcessMemory are not working!

$
0
0

I play Kingdom Hearts Re: Chain of Memories in the english version. In this game Sora can learn Strike Raid, which is a sleight where Sora throws his keyblade as a bumerang towards the enemy. When the thrown keyblade reaches the enemy, it hits him/her, deals some damage and stuns him/her and then returns to Sora's hands.

In standard, this happens ONLY ONCE, but I want Sora to do this over and over again without a break!

I have already used the scans of Cheat Engine 6.3 and I found out that in PCSX2's memory, there is a BYTE that is set to:

130 - At the START of Strike Raid: When Sora prepares to throw his keyblade.

131 - At the MIDDLE of Strike Raid: When the keyblade reaches the enemy.

132 - At the END of Strike Raid: When the keyblade returns to Sora's hands.

I found out that when I set this byte to 130 when it's value was 132 before, then Sora again throws his keyblade to the enemy as I want, but this is uncomfortable for every time to use Cheat Engine to set the value of this byte to 130 whenever it is 132.

So I want to write a Win32 API program in C++ language that will help me to do that.

I call FindWindow and GetWindowThreadProcessId to get the PCSX2 process ID, and then OpenProcess for this identifier with the OPEN_ALL_ACCESS right.

FindWindow, GetWindowThreadProcessId and OpenProcess don't fail, BUT ReadProcessMemory and WriteProcessMemory ALWAYS FAIL! And GetLastError() returns 5, which is ERROR_ACCESS_DENIED. I hate this! Cheat Engine HAS FULL ACCESS to any process's memory, but my program doesn't! I must use ReadProcessMemory to know when the value of the byte is 132 and WriteProcessMemory to set it to 130. This is very important to me that the program will do that, so I can be inactive and just watch Sora tortures the enemy for my fun and my pleasure, and also smile and laugh.

How to prevent Certificate Status and Revocation Checking on server with no internet access?

$
0
0

I’ve written some code using ABCpdf v8 to convert some HTML to PDF using the MSHTML engine. 
It works on my development machine (Win 7) and does not trigger any internet traffic to check certificates revocation. 
I have internet connectivity on my development machine but do not log any traffic with Fiddler.
However when we deployed this to a production server (2008 R2) with NO internet connectivity there is an attempt at internet traffic to the following (logged with Fiddler):

GET p://ocsp.usertrust.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBR8sWZUnKvbRO5iJhat9GV793rVlAQUrb2YejS0Jvf6xCZU7wO94CTLVBoCEEIa8pQJhBkfUgpLxiQmp0s%3D
502 Fiddler - Connection Failed (text/html)

GET p://crl.usertrust.com/AddTrustExternalCARoot.crl
502 Fiddler - Connection Failed (text/html)

GET ttp://ocsp.usertrust.com/MFEwTzBNMEswSTAJBgUrDgMCGgUABBRtl6lMY2%2BiPob4twryIF%2BFfgUdvwQUK8NGq7oOyWUqRtF5R8Ri4uHa%2FLgCEBBwnU%2F1VAjXMGAB2OqRdbs%3D
502 Fiddler - Connection Failed (text/html)

GET ttp://crl.usertrust.com/UTN-USERFirst-Object.crl
502 Fiddler - Connection Failed (text/html)

GET ttp://ocsp.comodoca.com/MFIwUDBOMEwwSjAJBgUrDgMCGgUABBSOJaE2H4hHYQzP74hlLuO41NG%2BEAQUHsWxLH2H2gJofCW8DAeEP7bP3vECEQCpfSZlqtzIFt17K%2FDaIrcn
502 Fiddler - Connection Failed (text/html)

GET ttp://crl.comodoca.com/COMODOCodeSigningCA2.crl
502 Fiddler - Connection Failed (text/html)

POST ttp://hfdwpmpapp02.mp.local/SORAppServices/TransactionSubmission.svc
200 OK (text/xml)

POST ttp://hfdwpmpapp02.mp.local/SORAppServices/SORAppController.svc
200 OK (text/xml)

POST ttp://hfdwpmpapp02.mp.local/SORAppServices/SORAppController.svc
200 OK (text/xml)

ABCpdf tells me that it is probably some Microsoft assembly triggering the CRL check as we are using the MSHTML engine.
The HTML to PDF conversion is successful, but we need to prevent this internet traffic. 
How do we make the production server behave like our development machine (Win 7 64bit) and not check for revocation?


Sudden listing of my application in smart screen filter

$
0
0

Hi All,

I have a windows exe which is not signed. Recently i released a new version of my application

When the user is now downloading the current version via IE , smart screen filter is identifying it as a harmful file.

But this was not happening till the previous version of my application. 

My question for smart screen filter algorithm is as follows /

(a) Is any unsigned application for the first time comes into the warning list ?

(b) After how many downloads of an unsigned application the entry is removed from the warning list ?

(c) Why the earlier versions of my application were not reported ?

cheers,

Saurav

vs 2013 W7: build says AxInetCtlsObjects.AxInet undefined - help registering AxInterop.InetCtlsObjects.dll or Interop.InetCtlsObjects.dll

$
0
0

I ported vb.net app from XP to W7 64 bit machine.

I get the following errors when I build it on W7 machine (using microsoft visual studio community 2013 Update 5):

Type 'AxInetCtlsObjects.AxInet'   is not defined.    C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\Form1NEW.Designer.vb

Type 'AxMSCommLib.AxMSComm'       is not defined.    C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\Form1NEW.Designer.vb

Type 'AxMSWinsockLib.AxWinsock'   is not defined.    C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\Form1NEW.Designer.vb

The Dlls I have that 'appear' to contain the references are located in the \bin and \obj folders of my project:

AxInterop.InetCtlsObjects.dll
AxInterop.MSCommLib.dll
AxInterop.MSWinsockLib.dll
Interop.InetCtlsObjects.dll
Interop.MSCommLib.dll
Interop.MSWinsockLib.dll

When I try to register any of the dlls - Regsvr32 gives error msg:

e.g.,

"...Was loaded but the entry-point DllRegisterServer was not found"

The cmd line commands I used were:

%systemroot%\SysWoW64\regsvr32.exe "C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\bin\AxInterop.InetCtlsObjects.dll"
%systemroot%\SysWoW64\regsvr32.exe "C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\bin\AxInterop.MSCommLib.dll"
%systemroot%\SysWoW64\regsvr32.exe "C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\bin\AxInterop.MSWinsockLib.dll"
%systemroot%\SysWoW64\regsvr32.exe "C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\bin\Interop.InetCtlsObjects.dll"
%systemroot%\SysWoW64\regsvr32.exe "C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\bin\Interop.MSCommLib.dll"
%systemroot%\SysWoW64\regsvr32.exe "C:\Hamlog\Vb2010Projects\VB_NET Logger2\VB_NET684 Logger initial W7 changes\bin\Interop.MSWinsockLib.dll"

Can someone please help me?


ftbrady

Microsoft.Speech.Synthesis.SpeechSynthesizer generates 'System.InvalidCastException' when doing chinese TTS

$
0
0

Using the Microsoft Speech SDK 11 for TTS,

but get the following exception:

An unhandled exception of type 'System.InvalidCastException' occurred in Microsoft.Speech.dll

With the following code:

using Microsoft.Speech.Synthesis;
using System;

namespace SampleSynthesis
{
    class Program
    {
        static void Main(string[] args)
        {
            speakString(1, "你好世界");
        }

        static void speakString(int i, String s)
        {
            // Initialize a new instance of the SpeechSynthesizer.
            SpeechSynthesizer synth = new SpeechSynthesizer();

            // Select a voice that matches a specific gender.
            switch (i)
            {
                case 0:
                    synth.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-US, ZiraPro)");
                    break;
                case 1:
                    synth.SelectVoice("Microsoft Server Speech Text to Speech Voice (zh-CN, HuiHui)");
                    break;
            }

            // Configure the audio output.
            synth.SetOutputToWaveFile(@"C:\Users\David\Desktop\TTStest\test.wav");

            PromptBuilder text = new PromptBuilder();
            text.AppendText(s);
            synth.Speak(text);
        }
    }
}

Using it to generate English files works fine.

I had to additionally download the files chsbrkr.dll and chtbrkr.dl, since I'm using windows 10.

Without those files I got the error:

System.InvalidOperationException: Speak error '80004005'

Can someone help me please?

I'm also open to any alternatives, e.g. System.Speech instead of Microsoft.Speech, if anyone can tell me how to acquire chinese voices (i.e. HuiHui).

Windows OCR Library usage issue

$
0
0

Hello experts,

Wondering if this library could be used for desktop applications (https://blogs.windows.com/buildingapps/2014/09/18/microsoft-ocr-library-for-windows-runtime/), besides Windows app store application and phone application? Thanks.

regards,

Lin

Is it possible to enable WiFi Direct(not WIFIDirectServices) in a windows service?

$
0
0

I am trying to create a windows service which would enable WiFiDirect and connect two system (Win10-Android /Win10-ios ). I am getting error at this line:

WiFiDirectDevice wfdDevice = await WiFiDirectDevice.FromIdAsync(ConnectionRequest.DeviceInformation.Id);

Severity Code Description Project File Line Suppression State Error CS1929 'IAsyncOperation' does not contain a definition for 'GetAwaiter' and the best extension method overload 'AwaitExtensions.GetAwaiter(Task)' requires a receiver of type 'Task' WIFI C:\\WindowsService1\Service1.cs 64 Active

i figured i have not referenced Universal Windows, but i get continuous error when i try and reference it. I think it wont work with a windows service. When i run the windows application which comes with sample it works, but that is an application i need a service. I am sure i am making many noob mistakes so please bear with me.

Missing api-ms-win-core-* DLLs

$
0
0

As described in question 35562218 on StackOverflow and my other question on the Microsoft Community forum (sorry - I can't post links until my account is verified) I am missing the following DLLs:

  • api-ms-win-core-libraryloader-l1-2-1.dll
  • api-ms-win-core-atoms-l1-1-0.dll
  • api-ms-win-core-winrt-error-l1-1-1.dll
  • api-ms-win-core-sidebyside-l1-1-0.dll
  • api-ms-win-core-localization-obsolete-l1-3-0.dll
  • api-ms-win-core-heap-l1-2-0.dll
  • api-ms-win-core-heap-l2-1-0.dll
  • api-ms-win-core-delayload-l1-1-1.dll
  • api-ms-win-core-libraryloader-l1-2-0.dll
  • api-ms-win-core-rtlsupport-l1-2-0.dll
  • api-ms-win-core-shlwapi-obsolete-l1-2-0.dll
  • api-ms-win-security-base-l1-2-0.dll

I've tried 'sfc /scannow', 'DISM.exe /Online /Cleanup-image /Scanhealth' and 'DISM.exe /Online /Cleanup-image /Restorehealth' to locate/fix missing files but it hasn't worked. I've got Visual C++ Redist x86 and x64 installed for 2008, 2010, 2012, 2013 and 2015 and I've got Visual Studio 2010 Express and Visual Studio 2010 Prerequisites x64 as well as Windows 7 SDK (7.0 and 7.1). I've search my entire hard drive for those DLLs but can't find them.

I've seen question "api-ms-win-core-libraryloader-l1-2-0.dll is missing" on this forum but I'm not trying to create a UWP and besides, I don't seem to have Windowsapp.lib either nor do I want it. I've seen many other posts indicating the missing DLLs should be in the C:/windows/(system32 or sysWOW64)/downlevel folder but they aren't there.

The API Sets sound like they might be what I'm looking for but I don't know where I can download those - I can only find a page telling me about them.

Surely these should be part of a library or SDK or something (other than Windowsapp.lib)? They've been mentioned as far back as Win 7. Where can I get them from?

Any constructive suggestions would be greatly appreciated (download from dodgydllwebsite.com would not be appreciated).

Windows 10: Toasts for Win32 and Desktop Enterprise Applications

$
0
0

In one of the Channel9 videos it was said that adaptive and interactive toasts should also be available for Win32 Applications and Desktop Enterprise Applications in Window 10.

Using a simple program that basically follows the example found on Github (from Channel 9 video) I always get “Element not found Exception” at:

     ToastNotificationManager.CreateToastNotifier().Show(toast);

In a Windows store application toasts have to be enabled in Package.appxmanifest – but a traditional desktop application projects do not honor this file.

Where can I check why this exception is thrown?

What is needed to get this feature working?


Getting list of currently Running Store apps with memory and CPU consumption details

$
0
0

Hey All ,

           I am developing a WPF application using Windows 10 and VS2015. I have one peculiar requirement that I would like to achieve. The requirement can be split as below

1. Get list of all the Store/UWP applications only that are running in the system presently along with their icons

2. Get the list of those apps with their image and CPU , Memory and Network consumption details.

These details are available in Task Manager but task manager is giving list of process that contains all process runiing in the system as well as background processes. My aim is to find the list of only Store apps 

Please refer to the image attached for more clarification .

I need the code in C#

any help would be great !


Apoorv Kumar Upadhyay

How to run MSI package as current user

$
0
0

Dear All,

I have created MSI package using WIX. Using this MSI package, launching an EXE after extracting the files.

After extracting the files, MSI package is launching an EXE to install the drivers. EXE (setup.exe will also required an admin privileges to install the drivers.

So, I have used InstallScope="perMachine", to display an UAC prompt before extracting files.

<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" AdminImage="yes" />


Also, my Custom action will be,

<CustomAction Id="InstallDRV" Directory="INSTALLDIR" Execute="deferred" ExeCommand="[INSTALLDIR]setup.exe" Impersonate="no" Return="check" />

After creating the MSI with the above options, by double clicking the MSI package, it displays an UAC prompt before extracting the files into target system.

After extracting file, setup.exe is launched and installed the drivers. But, it fails to set the default printer.

it failed to set the default printer in the below key.

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows

Please help me how to execute MSI as user administrator instead of System administrator privileges.

Regards,

Dileep

Problem Instantiating ActiveX Controls

$
0
0

We develop a desktop application and each TFS build is automated to create a VM and install the latest build on it.

Over the last few weeks our testers have been reporting that occasionally a build will have a problem where the application can't run - some investigation has revealed that it is caused by being unable to instantiate ActiveX controls.

However further investigation revealed that it wasn't our application that was causing the problem but something deeper.

This is an email from one of the developers looking into it:

I started looking into this today. There is something very strange about the VMs in which you cannot log into desktop. Using VB6 I created a really simple ActiveX dll with a single class containing a HelloWorld method. This has absolutely no dependencies on anything in our application. I successfully registered the dll on the dodgy VM and I can see the relevant entries in the registry. Then I used VBScript via Excel to try and create an instance of that control. I get a generic ActiveX error reporting that it cannot  be created. Nothing proprietary involved here, this is all Microsoft stuff.   This is essentially the same problem that we are getting in the desktop application. It can’t create instances of our ActiveX objects. I can see they are registered properly, but they can’t be created. I tried creating instances of our objects using VBScript and we get the same problem.

I wondered if it was some weird 32/64 bit issue so I went through the process of registering the DLLs from a 32bit command prompt and trying them. Then registering them from a 64bit command prompt and trying them. It made no difference, I still can’t create instances of them.

I’m beginning to suspect that some underlying ActiveX technology is missing from those VMs, or there is some sort of permissions issue. Why it is intermitted I cannot explain.  I can now say for sure that this is not an issue specific to our application, it’s deeper than that.

I had a look at the VM this morning - it is Windows Server 2008 R2 Build 7601 SP1, but we have had our application running fine on exactly this VM in other builds.

The exact error when trying to instantiate a simple ActiveX control is

ActiveX component can't create object: 'Test.Test123'

Code: 800A01AD

I looked up this code and came across this page:

https://support.microsoft.com/en-us/kb/194801

I ran the 32-bit dependency walker - I'll insert the image - it shows three files that are dependent not found:

GPSVC.DLL (Group Policy Client)

IESHIMS.DLL 

WLANAPI.ALL

Dependency Error

However this might indicate there is a problem with Dependency Walker on some files?

http://stackoverflow.com/questions/2465111/dependency-walker-reports-ieshims-dll-and-wer-dll-missing

Any further insights on how to proceed or what the best way to fix this problem would be appreciated.

Thank you.

[UWP]Unable to receive callback event for command toast schema for notification (Toast type) on Windows 10

$
0
0
Hi,

I am working to display toast notification with commands toast schema with scenario option 'incomingCall' along with associated command  "video" | "voice" | "decline". I have displayed toast notification with these option. 

To receive callback from command and content, i have registered the events handlers 'ToastEventHandler' implementation and it's working.

But i am not able to distinguish from which command invoked callback function, e.g - Whether callback function invoked from video command or voice command.

Please help me to resolve this.

Thanks,Rishu

Getting the actual amount of RAM available to an application

$
0
0

Hi folks,

I am working on an application that manages a huge amount of data (sometimes terabytes), and so it can't possibly fit all of that data into RAM at any given point in time. However, for performance purposes, the more I can cram into RAM, the faster certain algorithms will be on that data. So, I have a background thread that calls GlobalMemoryStatusEx(MEMORYSTATUSEX*) every second or so, and if the ullAvailPhys member of that MEMORYSTATUSEX struct is low, it frees up some of the cached data.

The problem is that Windows starts to kill my app for using too much memory even though this ullAvailPhys value is in the 2GB range. This seems to be a known issue with a decent description as to why. The OS has promised to keep some RAM available for other apps, but is reporting that RAM as available to my app. For details, see http://superuser.com/questions/684112/windows-8-64bit-say-low-memory-while-4gb-free

I am also aware that I could add a callback to notify me when allocations fail (I forget the details at the moment), and that callback could free up some of my cached data to make room for the new allocation. However, this kills my performance, because the thread trying to do the allocation has to stop everything and deal with the low memory situation. If I can probe the amount of RAM available to my program, then I could have a background thread find and delete some low-priority parts of my cache. 

So, any idea how I might find out how much RAM is available for my program to consume?

Cheers.


Viewing all 6180 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>