|
ICopyHOOK:
MSDN says
ICopyHook is a COM-based interface used to create a copy hook handler. A copy hook handler is a Shell extension that determines if a Shell folder or printer object can be moved, copied, renamed, or deleted. The Shell calls the ICopyHook::CopyCallback method prior to performing one of these operations.
No use for files.
|
|
|
|
|
|
|
Ya, but that is part of the shell, no separate executable is running only explorer.exe will do the job for that.
http://www.priyank.in/
|
|
|
|
|
There is one other thing even if this worked for files. It would not stop or detect someone from writing a 15 line program that read the file and saved it to disk.
John
|
|
|
|
|
John M. Drescher wrote:
not stop or detect someone from writing a 15 line program
Who said this software is for CP members, its just for my client
http://www.priyank.in/
|
|
|
|
|
Priyank Bolia wrote:
its just for my client
My guess is the file contains some type of code that will unlock the features of your program for one pc and you don't want him/her to copy the file to other computers violating the license. If this is so you could hide this in a hidden file in some folder that it not expected (several levels from the root) or better yet hide it in the registry as the average user would not find it there unless you name you name it something obvious...
John
|
|
|
|
|
John M. Drescher wrote:
My guess
Times Out......
You guess wrong, the problem is the original one only, I software "FileSecure" that makes a folder safe, you can read, edit, delete, copy, etc. on that folder on any Win platform and file system and also it should work in safe work.
http://www.priyank.in/
|
|
|
|
|
Hi,
I am developping a new CORBA application from Visual C++.
I reach to create new objects into a server and link their reference, i.e IOR, from a cliente in order to make calls to methods from its remote interface. I do all this using a text tile that the server writes and the client reads in order to get the IOR.
I would like to use a NameService in order to not using that text file and start developping a real remote distrubited application.
My code is the following one, and is the same as described for example by Omni distribution:
--------------------------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////
static CORBA::Boolean
bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref)
{
CosNaming::NamingContext_var rootContext;
try {
// Obtain a reference to the root context of the Name service:
CORBA::Object_var obj;
obj = orb->resolve_initial_references("NameService");
// Narrow the reference returned.
rootContext = CosNaming::NamingContext::_narrow(obj);
if( CORBA::is_nil(rootContext) ) {
cerr << "Failed to narrow the root naming context." << endl;
return 0;
}
}
catch(CORBA::ORB::InvalidName& ex) {
// This should not happen!
cerr << "Service required is invalid [does not exist]." << endl;
return 0;
}
try {
// Bind a context called "test" to the root context:
CosNaming::Name contextName;
contextName.length(1);
contextName[0].id = (const char*) "test"; // string copied
contextName[0].kind = (const char*) "my_context"; // string copied
// Note on kind: The kind field is used to indicate the type
// of the object. This is to avoid conventions such as that used
// by files (name.type -- e.g. test.ps = postscript etc.)
CosNaming::NamingContext_var testContext;
try {
// Bind the context to root.
testContext = rootContext->bind_new_context(contextName);
}
catch(CosNaming::NamingContext::AlreadyBound& ex) {
// If the context already exists, this exception will be raised.
// In this case, just resolve the name and assign testContext
// to the object returned:
CORBA::Object_var obj;
obj = rootContext->resolve(contextName);
testContext = CosNaming::NamingContext::_narrow(obj);
if( CORBA::is_nil(testContext) ) {
cerr << "Failed to narrow naming context." << endl;
return 0;
}
}
// Bind objref with name Echo to the testContext:
CosNaming::Name objectName;
objectName.length(1);
objectName[0].id = (const char*) "Echo"; // string copied
objectName[0].kind = (const char*) "Object"; // string copied
try {
testContext->bind(objectName, objref);
}
catch(CosNaming::NamingContext::AlreadyBound& ex) {
testContext->rebind(objectName, objref);
}
// Note: Using rebind() will overwrite any Object previously bound
// to /test/Echo with obj.
// Alternatively, bind() can be used, which will raise a
// CosNaming::NamingContext::AlreadyBound exception if the name
// supplied is already bound to an object.
// Amendment: When using OrbixNames, it is necessary to first try bind
// and then rebind, as rebind on it's own will throw a NotFoundexception if
// the Name has not already been bound. [This is incorrect behaviour -
// it should just bind].
}
catch(CORBA::COMM_FAILURE& ex) {
cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
<< "naming service." << endl;
return 0;
}
catch(CORBA::SystemException&) {
cerr << "Caught a CORBA::SystemException while using the naming service."
<< endl;
return 0;
}
return 1;
}
//////////////////////////////////////////////////////////////////////
int
main(int argc, char **argv)
{
try {
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
Echo_i* myecho = new Echo_i();
PortableServer::ObjectId_var myechoid = poa->activate_object(myecho);
// Obtain a reference to the object, and register it in
// the naming service.
obj = myecho->_this();
CORBA::String_var x;
x = orb->object_to_string(obj);
cerr << x << "\n";
if( !bindObjectToName(orb, obj) )
return 1;
myecho->_remove_ref();
PortableServer::POAManager_var pman = poa->the_POAManager();
pman->activate();
orb->run();
}
catch(CORBA::SystemException&) {
cerr << "Caught CORBA::SystemException." << endl;
}
catch(CORBA::Exception&) {
cerr << "Caught CORBA::Exception." << endl;
}
catch(omniORB::fatalException& fe) {
cerr << "Caught omniORB::fatalException:" << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
}
catch(...) {
cerr << "Caught unknown exception." << endl;
}
return 0;
}
.....................................................................................................
I run the application omniNames.exe with parameters:
omniNames.exe -start 12345 .. . . . .
That seems to work. It runs in console mode, not as a service.
If I execute my server, with the code descrive on top, I get the following exception error:
catch(CORBA::SystemException&) {
cerr << "Caught CORBA::SystemException." << endl;
}
Otherwise, If I replace the following line
obj = orb->resolve_initial_references("NameService");
for that one:
obj = orb->resolve_initial_references("corbaloc:iio:localhost:12345/NameService");
Now, I don't get the same error, I get other one:
catch(CORBA::ORB::InvalidName& ex) {
// This should not happen!
cerr << "Service required is invalid [does not exist]." << endl;
return 0;
Does anybody have any idea what is happening?
Must I run omniNames as a service? and if so, Why?
Do I need other configuration?
I would like to use Omni CORBA distrubution.
Thanks, and pardon for my english ( I am spanish... )
.
|
|
|
|
|
I think that you have trouble locating your nameming server. Did you start up a naming server?
Blog[^]
|
|
|
|
|
Thanks for answering...
Yes, I think.
I started NameService as follows:
"C:\omni\bin\x86_win32\omniNames.exe -start 12345 -logdir C:\omni -errlog C:\omni\errlog"
It seems I have initialized my NameService at port 12345
I have created my NameService.bat on it and It seems to work. I runs.
The problem is when I run my Server.
Is there anything more I have to do?
.
|
|
|
|
|
Yes, the following things should always be done (with every code you write)
<list> Write code that handles errors where errors can be expected (you did this)
If you find an error don't just print "ERROR" Print as much information as you can. This information often is found in the caugth exception, or can be obtained through some api's
Without that information, many things could be happening. Maybe you run a firewall that blocks your namingserver, etc...
Blog[^]
|
|
|
|
|
Hi everyone,
in your resources you can set resources for different language. The appropriate language is loaded according to you windows language. Therefor in your resource file you have to add e.g. '#if defined(AFX_TARG_NLB)' for you dutch resources.
Now, I have a database containing a field with strings in dutch in it and a field with its english translations. If the dutch resources are loaded I want to take the dutch field. I no dutch resources are loaded I want to take the english field.
Therefor I want to do this in my cpp file:
#if defined(AFX_TARG_NLB)<br />
m_iLanguage = Dutch;<br />
#else<br />
m_iLanguage = English;<br />
#endif
And use the m_iLanguage variable in my database query for fetching the right language.
I guess AFX_TARG_NLB is defined if the windows version has dutch language, AFX_TARG_ENG when windows has english language. These macros seem to be only defined in .rc files.
So the problem is: the AFX_TARG_... are not defined in my cpp files. How comes and does someone know how to solve it?
µAnother thing, does someone has a solution for this: http://www.codeproject.com/script/comments/forums.asp?forumid=1647&XtraIDs=1647&searchkw=afx_targ_enu&sd=2%2F26%2F2001&ed=5%2F27%2F2005&select=463413&df=100&fr=92935.5#xx463413xx[^]
thx
|
|
|
|
|
I’m about to insert a Win32 window in a CWnd (or more specific an COleControl). I’m an old MFC-coder and not really good att Win32 API. After what I understand I should take care of the HWND instance of CWnd…
How do I make the sole Win32 window to stretch over my CWnd… ?
Thanks in advance…
_____________________________
...and justice for all
APe
|
|
|
|
|
I'm having a problem with the CreateControl method of the CWnd object.
I can create the ActiveX but it seems that the Ctrl-c and Ctrl-v is not forwarded to the Active X but all the general key press works.
When i insert the ActiveX in the OLE test container the Ctrl-c and Ctrl-v works fine.
Please help me.
Thanks
|
|
|
|
|
Johan Odin wrote:
I can create the ActiveX but it seems that the Ctrl-c and Ctrl-v is not forwarded to the Active X but all the general key press works.
Have you got an accelerator table loaded which has those combinations as a shortcut? If so, you'll have to disable it or remove the combinations you want the control to handle.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
A very big thanks to you Ryan, now it works!
|
|
|
|
|
no no, i'm not spaming the forum...
i have the following code :
BOOL CMSILauncherDlg::OnEraseBkgnd(CDC* pDC) {
<font color=green>
CBitmap BackGroundBitmap;
BackGroundBitmap.LoadBitmap(IDB_BGND);
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
MemDC.SelectObject(&BackGroundBitmap);
CRect ClientRect;
GetClientRect(&ClientRect);
CPoint OriginPoint(0, 0);
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
BackGroundBitmap.GetBitmapDimensions().cy);
<font color=blue>for</font> (OriginPoint.y = ClientRect.top; OriginPoint.y < ClientRect.bottom; OriginPoint.y += BGBitmapSize.cy) {
<font color=blue>for</font> (OriginPoint.x = ClientRect.left; OriginPoint.x < ClientRect.right; OriginPoint.x += BGBitmapSize.x) {
pDC->BitBlt(OriginPoint.x,
OriginPoint.y,
BGBitmapSize.cx,
BGBitmapSize.cy,
&MemDC,
0,
0,
SRCCOPY);
}
}
<font color=blue>return</font> 1;
}
the above code doesnt work till the BackGroundBitmap.GetBitmapDimensions() return {0, 0} as size...
if i manually replace the function calls by the actual bitmap size, the function work quite fine (in fact, the bitmaps are not well "mosaic-ed" but spaced - maybe a unit problem).
<font color=green>
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
BackGroundBitmap.GetBitmapDimensions().cy);
<font color=green>
CSize BGBitmapSize(190, 187);
<font color=green>
BackGroundBitmap.SetBitmapDimensions(190, 187);
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
BackGroundBitmap.GetBitmapDimensions().cy);
does anyone already encountered this problem ?
any suggestions or solutions ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Use CBitmap::GetBitmap to fill a BITMAP structure. Use BITMAP::bmWidth and BITMAP::bmHeight for the size of the bitmap in pixels.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
PJ Arends wrote:
...for the size of the bitmap in pixels.
from the MSDN, they say for CDC::BitBlt :
Parameters
x
Specifies the logical x-coordinate of the upper-left corner of the destination rectangle.
y
Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.
what is called a logical coordinate ? pixels ? or dbu ?
are there any functions to convert pxl <---> dbu ??
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
logical coords are never dbu. What they are depends on the mapping mode of the DC. See CDC::SetMapMode(). If you do not explicitly set the map mode to something else it will be MM_TEXT and logical coords will be pixels.
Use MapDialogRect() or GetDialogBaseUnits() to convert between pixels and dbu, although I have no idea why you would have to just for displaying a bitmapped background. GetClientRect() will give you the dimensions of your window in pixels.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
An alternate method to tiling a bitmap over a window is to use CreatePatternBrush [^] to create a brush, and then use FillRect [^] to fill the window. This approach automatically takes into account the size of the bitmap, the window, and so on.
Software Zen: delete this;
|
|
|
|
|
but i don't want to fill, i want to mosaic my bitmap...
thanks anyway for your answer
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
good morning everybody,
As some of you might have sees yesterday, I have some trouble with reactivating an already existing instance of a program of my own which lost the focus.
Mr DavidCrow suggested me to use EnumWindows() , but as i am not familiar at all with CallBack functions, i'd be grateful if some of you post a little example of use of the this functions.
the best would show how to get the handle of a particuliar windows...
thank to all of you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|