-
Power Registry Object
Hello, I want to write an extension Power Registry Obiect.
It will have functions such as registry2. With the addition of read and write values such as: REG_BINARY, REG_QWORD, REG_MULTI_SZ, REG_EXPAND_SZ. But I just need help to compile because I do not have VC++.
-
Re: Power Registry Object
Visual C++ 2008 Express is free from Microsoft.
-
Re: Power Registry Object
http://www.fusionwiki.com/wiki/Getting_started_with_Extension_Development - there's a link on there (and a lot of other useful information)
-
Re: Power Registry Object
Is it possible to write extension of acting only with version R249?
By the way I have a problem with the conversion of template from VC + + 2006 to VC + + 2010 Express.
The project file "C:\Users\User\Desktop\rSDK\Extensions\Power Registry\rSDK.dsp" canot be loaded.
C:\Users\User\Desktop\rSDK\Extensions\Power Registry\rSDK.dsp : error : Project upgrade failed.
-
Re: Power Registry Object
You need the 2008 version, not the 2010 version.
-
Re: Power Registry Object
There isn't even a 2006 version, but 2010 should work.
-
Re: Power Registry Object
I will try with 2006 version today.
-
Re: Power Registry Object
-
Re: Power Registry Object
You should also load the .dsw (workspace) the first time, and then the .sln (solution) after it's been converted.
-
Re: Power Registry Object
Speaking of registry, is there any keyword for writing to default? I've tried "@", "(default)" and stuff like that, but no cigar
-
Re: Power Registry Object
-
Re: Power Registry Object
If I understand you correctly you should use the function derived from the times of Windows 3.11 "RegSetValue" It sets the default value in key. However, for the record values, I recommend "RegSetValueEx" and set it to "".
Example:
Code:
HKEY hkSoftware, hkTest;
LONG result;
DWORD dwDisp;
HKEY hkSoftware;
LONG result;
result = RegOpenKeyEx(HKEY_CURRENT_USER, "software", 0, KEY_ALL_ACCESS, &hkSoftware);
if(result == ERROR_SUCCESS)
MessageBox(hwnd, "Key was opened.", "Test", MB_ICONINFORMATION);
result = RegCreateKeyEx(hkSoftware, "test", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkTest, &dwDisp);
if(result == ERROR_SUCCESS)
if(dwDisp == REG_CREATED_NEW_KEY)
MessageBox(hwnd, "The new key is created.", "Test", MB_ICONINFORMATION);
else if(dwDisp == REG_OPENED_EXISTING_KEY)
MessageBox(hwnd, "Existing key was opened.", "Test", MB_ICONINFORMATION);
char buf[20];
lstrcpy(buf, "");
result = RegSetValueEx(hkTest, "MyValueName", 0, REG_SZ, (LPBYTE)buf, lstrlen(buf)+1);
if(result == ERROR_SUCCESS)
MessageBox(hwnd, "value is set.", "Test", MB_ICONINFORMATION);
BTW rSDK works with VC++ 2008.
-
Re: Power Registry Object
I have problem with pure template compile errors...
Debug.zip
-
Re: Power Registry Object
I am no expert, but I am pretty sure you don't compile the template :/ I think the whole reason it is a template is because you fill it in with your code where it needs to go.
-
Re: Power Registry Object
Has not yet added any line of my code. I tried to compile a clean template.
Code:
c:\users\user\desktop\rsdk\inc\rtemplate.h(41) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1> c:\users\user\desktop\rsdk\inc\rtemplate.h(81) : see reference to class template instantiation 'rVector<T>' being compiled
-
Re: Power Registry Object
Quote:
Originally Posted by Jamie
http://www.fusionwiki.com/wiki/Getting_started_with_Extension_Development - there's a link on there (and a lot of other useful information)
:/
-
Re: Power Registry Object
ahh... "inline void operator = (rVector<T> &O)" Thanks Looki.
-
Re: Power Registry Object
Another one problem...
1>Linking...
1>LINK : cannot create map for .ILK file; linking nonincrementally
1>LINK : fatal error LNK1104: cannot open file 'C:\Program Files\Multimedia Fusion 2\Extensions\rsdk.mfx'
I read it:
"When it's all ready, build it and then copy the built MFX file to MMF's extensions folder. By default, rSDK's template builds to C:\Program Files (x86)\Multimedia Fusion Developer 2\Extensions\rSDK.mfx. You should change this in your project properties to build to your own MMF2 directory. "
but this is not helpful...
-
Re: Power Registry Object
Basically you have to have it set to where you installed MMF2.
-
Re: Power Registry Object
I just don't have rsdk.mfx in extension folder ;/
Anyone can send it to me?
-
Re: Power Registry Object
No, you are building rsdk.mfx .. that is your extension. This error occurs most frequently when you've already built the extension and you have a project open in MMF using that extension, so the file is locked.
Double check that your path is correct? For example, if you're on 64bit windows, MMF would be installed to "Program Files (x86)"
-
Re: Power Registry Object
Just curious, what is that funky weird (x86) thing there? What is it for?
-
Re: Power Registry Object
I am using the correct path and I have a 32bit system
Edit: It works when I changed it to d:\rsdk.mfx -.-"
-
Re: Power Registry Object
You may want to actually close MMF2 entirely and just build it to the MMF2 Directory so you don't need to move the file ;)
-
Re: Power Registry Object
My MMF was closed the whole time but I had set the record lock on drive C. Now I can start writing my extension. :)
-
Re: Power Registry Object
See it please:
Menu.h
Code:
#ifdef ACTION_MENU
SUB_START("Current Key")
SUB_START("Set Current Root Key")
ITEM(0,"HKEY_CLASSES_ROOT")
ITEM(1,"HKEY_CURRENT_USER")
ITEM(2,"HKEY_LOCAL_MACHINE")
ITEM(3,"HKEY_USER")
ITEM(4,"HKEY_CURRENT_CONFIG")
SUB_END
ITEM(5,"Set Current Key")
SEPARATOR
ITEM(6,"Create Current Key")
SEPARATOR
ITEM(7,"Set String Value")
ITEM(8,"Set Binary Value")
ITEM(9,"Set DWORD Value")
ITEM(10,"Set QWORD Value")
ITEM(11,"Set Multi String Value")
ITEM(12,"Set Expand String Value")
SEPARATOR
ITEM(13,"Delete Current Key")
ITEM(14,"Delete Value")
SUB_END
#endif
main.cpp
Code:
ACTION(
/* ID */ 0,
/* Name */ "Set root key to HKEY_CLASSES_ROOT",
/* Flags */ 0,
/* Params */ (0)
) {
CurrentRootKey = HKEY_CLASSES_ROOT;
}
ACTION(
/* ID */ 5,
/* Name */ "Set current key to %0",
/* Flags */ 0,
/* Params */ (1,PARAM_EXPSTRING,"Set current key")
) {
CurrentPatchKey = (char *)Param(TYPE_STRING);
}
I tred to use action with id 5 but when I did it my extension use action nr id 0 and I don't know why...
-
Re: Power Registry Object
First of all, use rdPtr to store the key and all that - the rdPtr is a pointer to your object in the memory. You can initialize the values in CreateRunObject in Runtime.cpp.
To define the variables, open Data.h and put the definitions in the tagRDATA struct.
Here's the clue: You have to declare all actions up to 5 in order to use action 5. That's it.
EDIT: Oh, and you're storing the pointer given to you by Param(TYPE_STRING), but that won't help much because the string will be deleted after the action is executed. You have to use strdup() to copy it.
-
Re: Power Registry Object
I want first get text in action from MMF and next get number how to do it?
Code:
/* Params */(2,PARAM_EXPSTRING,"Value name",PARAM_NUMBER,"Set Value")
It does not work...
error C2084: function 'short ActionFunc8(LPRDATA,long,long)' already has a body
edit@:
problem is solved.
-
Re: Power Registry Object
The extension is nearly finished, but I have a little trouble.
HKEY CurrentRootKey variable always contains the name of the key but expression returns nothing.
Code:
EXPRESSION(
/* ID */ 1,
/* Name */ "RegKey$(",
/* Flags */ EXPFLAG_STRING,
/* Params */ (0)
) {
ReturnString(CurrentRootKey);
}
-
Re: Power Registry Object
The code is correct. Do you have an expression with ID 0 before that (Should crash otherwise)? Does CurrentRootKey REALLY contain anything? Debug it, or if you don't know how, just put it in a MessageBox() before returning.
-
Re: Power Registry Object
Look:
Code Snippets
Code:
HKEY CurrentRootKey, hWnd;
//...next Snippet...
// This action working properly
ACTION(
/* ID */ 0,
/* Name */ "Set root key to HKEY_CLASSES_ROOT",
/* Flags */ 0,
/* Params */ (0)
) {
CurrentRootKey = HKEY_CLASSES_ROOT;
}
//...next Snippet...
// This action working properly too
ACTION(
/* ID */ 5,
/* Name */ "Open key %0",
/* Flags */ 0,
/* Params */ (1,PARAM_EXPSTRING,"Open key")
) {
result = RegOpenKeyEx(CurrentRootKey, (char *)Param(TYPE_STRING), 0, KEY_ALL_ACCESS, &hWnd);
}
//...next Snippet...
// This action does not return value of CurrentRootKey
EXPRESSION(
/* ID */ 1,
/* Name */ "RegKey$(",
/* Flags */ EXPFLAG_STRING,
/* Params */ (0)
) {
ReturnString(CurrentRootKey); // Return null but messagebox return it correctly.
}
There are no crash.
Btw THANKS for help I am just newbie. :)
-
Re: Power Registry Object
You didn't have to do this whole project, you know; I would've been happy to modify my Registry++ Object. :grin:
[size:8pt]Although I probably wouldn't have gotten done as quickly as you. ;)[/size]
-
Re: Power Registry Object
Mhm that's weird. It should crash from my experience: If you want to use expression 1, you will need expression 0 as well. Same goes for action 5. You'll need 0-4 as well:
PHP Code:
ACTION(0, [...]
ACTION(1, [...]
ACTION(2, [...]
ACTION(3, [...]
ACTION(4, [...]
//After you have defined actions 0 to 4, you can use 5 as well
ACTION(
/* ID */ 5,
/* Name */ "Open key %0",
/* Flags */ 0,
/* Params */ (1,PARAM_EXPSTRING,"Open key")
) {
result = RegOpenKeyEx(CurrentRootKey, (char *)Param(TYPE_STRING), 0, KEY_ALL_ACCESS, &hWnd);
}
-
Re: Power Registry Object
... I'm pretty sure that's why he put "//Next snippet"
I think he's taking just the parts of the code that relate.
-
Re: Power Registry Object
Oh, right. For one, as I said, you'll have to duplicate the string before returning. MMF will destroy it automatically. The odd thing is that the string is not displayed at all - I can't think of any reason for that to happen.
-
Re: Power Registry Object
I will check it out, but for the moment I'm doing a break in the programming of my extensions because I want to finish the course of programming in C++. When I do it I will resume and introduce many new features to my extension.
Please be patient...
-
Re: Power Registry Object
You can dowload beta version from: PowerRegistry.zip
You need to put file in folders data\runtime and extensions.
This is my first extension. :)
-
Re: Power Registry Object
It isn't showing up in my extension list as far as I can see. :\
-
Re: Power Registry Object
Try looking in the All objects.
-
Re: Power Registry Object
I am. What is is called in the list?