Visual C++ :: Can't Load 64-bit Key Using RegLoadKey In 32-bit Service
Dec 19, 2012
I need to open up and modify a user's registry key from a 32-bit service (note that the user is not logged in at the time.) I do the following:
Code:
//For simplicity error checks are not shown
//I also made sure to enable the following privileges:
// SE_RESTORE_NAME, SE_BACKUP_NAME
[Code]....
The problem is that the "SoftwareClassesLocal SettingsSoftwareMicrosoftWindowsCurrentVersionTrayNotify" key isn't loaded, even though I know that it exists in the actual user profile. I can verify that by loading the user account and by using 64-bit regedit.
View 5 Replies
ADVERTISEMENT
Jan 18, 2013
I have a Visual C++ workspace that has 2 projects (1 exe & 1 DLL). I used Serge Wautier's tutorial [URL] .... to create (multi-language) resource DLLs (satellite DLLs) branching off the exe.
Now I have a collection of strings in the DLL that are shared in other projects. I created a satellite DLL for that DLL but can't figure out how to load it on-demand just like the exe's satellite DLL.
He used:
HINSTANCE hDll = LoadLibrary(szFilename);
AfxSetResourceHandle(hDll);
void CLanguageSupport::UnloadResourceDll() {
if (m_hDll!=NULL) {
SetResourceHandle(AfxGetApp()->m_hInstance); // Restores the EXE as the resource container.
FreeLibrary(m_hDll);
m_hDll= NULL;
}
}
etc etc ... for the unloading/loading satellite DLLs for the exe. But how to do the same for the DLL?
View 5 Replies
View Related
Dec 9, 2014
I'm trying to write to a named pipe created by a service, as we all know the session 0 isolation implemented in vista and forward makes this task a bit complicated.
well at this point i managed to make almost all to work but my real problem comes when i try to write on the named pipe from my GUI application with no administrator rights
If i run the GUI application with admin rights it works 100% but, I don't need that application to require the user admin rights and for security reasons i rather to leave it without admin...
so i started my research and i found that there is a way to achieve this by calling CreateNamedPipe() with a low integrity security attributes...
well how to implement but i finally made it, the problem is that it gets worse than passing null security attributes, it works with admin rights with NULL security attributes, but when i pass the low integrity security attributes it gives "access denied" even when using admin rights, so i guess im passing the wrong security attributes but how to manually create the security descriptor string.
This is the code:
Service (session0) SERVER
Code:
DWORD WINAPI PipeThreadRSVS(void* pParameter){
LPTSTR _PIPE_NAME = "\.pipeRSVHPipeIn";
bool Break=false;
char Received_Buffer[BlockSize+16];
DWORD BytesRead = 0;
[Code] ....
View 2 Replies
View Related
Aug 1, 2013
I am trying to reuse some code from my Visual C++ 2005. I am using CArchive to ReadString the first line of a file into another string. However, I am seeing squares where there should be spaces when I view it in the debugger.
Here's the code:
if( cfSAP.GetStatus(csRegExtractFileRemote, cfsStatus)) {
if( !cfSAP.Open( csRegExtractFileRemote, CFile::modeRead, &ef ) ) {
cout<<"FAILED
"<<endl;
ef.ReportError();
[Code] ....
I am not able to read the lines due to this bug ,
This is normal text file contains two lines of information like this
0234568374C186-M-233545 SHAFT MATNUMBER1
0234564565C153-C-349578 BRACKET MATNUMBER2
View 4 Replies
View Related
Nov 22, 2012
I am working to load CoInitialize using getprocaddress, but I don't know why this function fail and cash program! It didn't happen with other functions in other libraries like kernel32.dll. Here is my test :
Code:
typedef HRESULT (*pf)(LPVOID);
pf rf = (pf)GetProcAddress(LoadLibrary(ole32.dll), "CoInitialize");
CoInitialize(NULL); // This line crashes the program!!
why and how to properly load it ?
View 1 Replies
View Related
Apr 15, 2013
I am doing an exercise that reads in a text file and loads the data into a struct. My problem is it doesn't read anything from the text file. I think it's the way I'm loading the data. Oh, it does read in the first record that tells the program how many contributor records to create, but nothing after that. Here it is:
Code:
//
#include <iostream>
#include <fstream>
#include <cstdlib>
const int strsize = 30;
const int SIZE = 60;
struct contributions {
char fullname[strsize]; //name
double donation; //donation
[Code] ....
Here is the record input:
Data file:
4
Suz Stuz
55000
Froco Frock
5000
Yandi Yuck
100500
Dippy Dip
120000
9 records - each struct has two members; full name and donation. First record should be number of contributors ...
View 12 Replies
View Related
Dec 31, 2013
I dumped all symbols into C:WindowsSymbols folder, It takes more than 2 minutes to load an application which really surprises me. Why and when should I use those symbols?
View 1 Replies
View Related
Aug 26, 2012
I am using an increasing number of applications which can be serviced from a web page. These apps do not need tomcat, apache or IIS to be installed but they are able to serve out web pages on demand.
Question is how is this done? Is it just a thead polling a port, waiting for a mime message and then chucking out the content or is it something more complex than that?
View 3 Replies
View Related
Sep 20, 2013
I'm trying to make this run as a service so that kbhit can be interacted with even when the console is out of focus. How would I do this?
View 3 Replies
View Related
Mar 28, 2014
I have a Windows desktop application with 2 projects. The main project, and a simple windows service project. I have written the service and the service installer. I have added code to my main window to start the service, but I can't figure out how to install the service when the application runs for the first time, or is installed. Ideally I would like the service to be installed when the application is installed, I'm just not sure how to do that.
View 1 Replies
View Related
May 16, 2014
I'm trying to read a data returned from a web service. How i could extract the juice of this document in c#?
Here's the code
<?php
require_once("nuSOAP/lib/nusoap.php");
//require_once("Classes/Connection.class.php");
//require_once("Classes/Customer.class.php");
require_once("includes/config.php");
[Code] ....
How will i extract the result from the Array Customer?
View 2 Replies
View Related
Nov 16, 2014
I have WCF web service which contains methods for communicating with database (ms sql). For a long time I was using pure sql statements, that aren't secure. It is time to move to parameterized queries. I'm using code-engine.com source code for query builder. Example of it is here: SelectQueryBuilder: Building complex and flexible SQL queries/commands from C# . Which works OK and I have no problems when is used inside of web service.
The problem: I also have asp.net web site which uses this webservice and the main problem is, how to build queries on client side and sent them to web service? I can build query on client side and send dbCommand.commandtext but I then I don't know how to send parameters list to webservice, because it isn't serialized.
This would be used as "universal" method for sql statements. I have others method like getUser(),getUsers(),getPages() but I really need this kind of methods to pass query to it.
View 1 Replies
View Related
Jun 7, 2012
I have an client application and server application, I want to make an update program, In my program I want client send a message to server if there is an new version or not, and server reply with a text message ,send will be done via web service .
View 1 Replies
View Related
Oct 17, 2014
I am trying to get my service to install into services but it will not. When I go to the command line and run the InstallUtil.exe service.exe it fails miserably. This is what I get on my console:
The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:publish codeImportImport. exe assembly's progress.
The file is located at C:publish codeImportImport.InstallLog.
Committing assembly 'C:publish codeImportImport.exe'.
Affected parameters are:
logtoconsole = true
logfile = C:publish codeImportImport.InstallLog
assemblypath = C:publish codeImportImport.exe
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C: publish codeImportImport.exe assembly.
Remove InstallState file because there are no installers.
The Commit phase completed successfully.
The transacted install has completed.enter code here
View 2 Replies
View Related
May 29, 2014
I had created windows service .from that i just want to insert data into database . It is successfully installed but it is not started. It gives an error service could not started...
View 14 Replies
View Related
Jul 1, 2014
I have an application based around a WCF Duplex service. I have problems when the user "Restarts" the work the application does... under the hood, the client side closes the connection to the WCF service and creates another. The Service contract is defined like so...
[ServiceContract(Namespace="net.tcp://namespace.MyService",
SessionMode=SessionMode.Required,
CallbackContract=typeof(IServiceCallback))]
public interface IMyService {
[OperationContract(IsOneWay=true)]
[Code] ....
The issue I see is that the _context.Close() call always times out and throws an exception. Although I'm then aborting the channel, this feels wrong to me, and I believe it's the cause of freezing in my application. Why the Close() call fails?
I missed something earlier regarding my callback implementation that might be relevant. It looks something like this:
[Callbackbehavior(ConcurrencyMode = ConcurrencyMode.Single,
UseSynchronizationContext = false,
IncludeExceptionDetailInFaults = true)]
public class CallbackImplementation : IServiceCallback {
public void SendMessage(string message){
// Do something with the message
} }
The exception message is "The ServiceHost close operation timed out after 00:00:30. This could be because a client failed to close a sessionful channel within the required time. The time allotted to this operation may have been a portion of a longer timeout.". There's no inner exception.
The big problem is that the client application freezes when the main application process is started after one client has been disposed and a new one created. I've also noticed that when you close the WPF application, it doesn't close properly and keeps running in the background, preveting you from starting a new instance.
View 1 Replies
View Related
Nov 7, 2012
I have written a windows service which run continuously on a server. Interval time is 9 sec. On timer1_interval i am fecthing record from database and sending it to user. And changing its record status.
this service stop fetching records after running 4 to 5 days. We need to restart the service. there is no GUI involve in this code
View 1 Replies
View Related
Feb 13, 2015
I am developing project on window application in c#.net. I want to consume the data from the web service and that web service is developed in PHP. So, How to give the reference of that web service?
View 1 Replies
View Related
Feb 10, 2015
am trying to create a service that will try to create a service that will monitor a folder. Whenever a new file gets created, I am trying to read the contents of new file and copy contents (with same file) at a new location.
The problem I am facing is that only first file that gets its name copied and a file created at a new location, but without any contents. The subsequent files do not get created at all.
My Services.cs looks like this:-
public partial class Service1 : ServiceBase
{
public Service1()
{
[Code]....
View 7 Replies
View Related
Jul 24, 2012
Just now I started learning Windows services.I want to create a windows Service that will call the stored procedure every 30 days.
View 1 Replies
View Related
Jun 16, 2013
I'm new to programming, and I'm working on my second c++ program right now. Its a dating service where you read data from an input .txt file and store into a linked list, so then you can search, and modify the data. The text file is in this format:
M Dr.Gregory House,237-8732 7 Vicodin,Guitar,Piano,Motorcycles,Television,Food,W hiteboards.endl; (all on a single line).
First, is the sex (M or F), then the person's name, phone number, number of interests, then a list of their interests (with commas between each one, and a period at the end.) and then if they have a match you put their name there and put endl; after.
The main problem I'm having is setting up the link list, how to get it to read those as variables in the text, I know you have to use delimiters, but I can't quite figure out how to use them. You also have to keep two lists, one for males, and one for females in the output file. How do I do this? Is that a double linked list?
Here is the code so far (I know it isn't much..)
#include <iostream>
#include <fstream>
#include <string>
#include <limits>
#include <cstring>
using namespace std;
//Functions
void echoPrint();
[Code] .....
View 2 Replies
View Related
Oct 11, 2014
I have a problem with an extension DLL that has an exported function. The function is being exported ok, it is called by a Windows service. The Windows service is using the exported function, and everything works. I am trying to create a file with:
ofstream file;
file.open("C:dir ofile", ios:ut);
file << "text";
But nothing happnes however. There are no errors, the file is just not created. Also, if i try to call MessageBox() in the exported function, nothing happens as well . I have a .h file which exports the function with __declspec(dllexport) DWORD WINAPI functionName(), and also a .cpp file with the function definition. There is no main().
View 4 Replies
View Related
Aug 22, 2012
Windows service not able read file from network even after giving UNC path whereas works fine when given local directories ....
View 1 Replies
View Related
Sep 26, 2013
Let's say I create a small program or just want to open any kind of file on my computer, but I want to run a program that forces the user to enter a password or something (I already know this part). How does one create the code that would open the file?
View 5 Replies
View Related
Dec 22, 2014
When server send data then client receive that data, in C# windows services where data receive continuously (Using IP Address and port number) . This below code writing in console application . i want implement same logic in windows service side. but i want data receive continuously.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
[Code]....
Above code write in console application, same logic implementing in windows service, but i want data receiving continuously
View 3 Replies
View Related
Nov 26, 2013
I am trying to put my Save and Load function in my game, this is what i have:
Code:
/* Save game */
void GuardarJuego() {
FILE *fsave;
char turno;
fsave=fopen("SAVE.txt", "w");
fputs(*****, fsave);
[Code] .....
My game code is this: [C] GameCode - Pastebin.com
View 8 Replies
View Related