|
Is is possible to turn the following macro into a template? I'm unsure about the ##i.
#define S(x,i) (SBoxes[i][x.w.byte##i])
Todd Smith
|
|
|
|
|
Working with the blowfish encryption ???
The ## operator with the proprocessor only works because it modifies the code before the compiler gets to it.
1) You could accomplish the same things but you will need to change the main data block union that is used to array notation and that would work.
2) Or you could change the bf_F macro to send in the name of the variable.
I would probably do the first suggestion if you dont like the macro syntax.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I'm not sure.
Templates needs to be figured out at compile time - not before and not after. Your piece of code is first transformed pre compile time (##-operator) and runtime - access of instance data.
Since x and i seem to be runtime data, this model would probably not work well using templates. However, I'm sure if you'd redo the whole model to suit templates there is most likely a solution.
--
Please state the nature of your medical emergency.
|
|
|
|
|
Hello, Im trying to create a simple win32 application that will popup with a messagebox which shows the data a specific key in the registry.
The only thing I can't figure out is how to access the registry and dump the data in the key I need. I searched on MSDN.microsoft.com but I didn't find anything..
Thanks
|
|
|
|
|
Read the 8th posting below this one.
|
|
|
|
|
You can find several classes here in CP to Access the regsitry...
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Ok. I had a post earlier about my app failing in release mode. Thanks, to some help on here, I thought I had it narrowed down to the MSFlexgrid.ocx control delivered with VS6. I have read and was told that to redistribute the control you must have a runtime license embedded in your application.
The wierd thing is that another developer that I work with was able to distribute his control on a PC w/o VS6 installed, and it worked. Blew me away. So, I duplicated what he did and it worked too.
The method? Ensure that the control is in your resource workshop toolbox by Project | Add To Project | Components and Controls. Once, it's there you must add it to your dlg or form view, using the class wizard so it will DDX it for you. U see, I sometimes don't use the class wizard since I was dynamically creating and deleting the grid controls and a tab control. I've changed this approach now to just statically use the controls and make visible/invisible what I don't want the user to see.
Apparently, this somehow embeds the license into it??? Cuz, I simply ran the install program (which only copies and registers the control) and it works fine, now.
Go figure!! Anybody know about why this works?
|
|
|
|
|
What do you think of making a Boehm GC - Object Oriented framework for interacting with Windows?
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
|
Perhaps I'm not clean enough.
While the Boehm GC exists, there is no User Interface Framework nor a framework that interacts with the Windows API (for the public developer) which uses it. (If so, please respond)
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
Hio guys.. i am currently running a program using the following code.. it runs the other program and continues on instantly.. is there a way to run a process and wait for it to finish before continuing on? here is what im using right now:
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
char cmdline[300];
sprintf (cmdline, strExePath);
if( !CreateProcess( NULL,
cmdline,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi )
)
{
CString strTemp = "Unable to open file:\n" + strExePath;
AfxMessageBox(strTemp);
return FALSE;
}
thanks for any pointers!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
try :
// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );
|
|
|
|
|
I have a text file generated by another program called:
test.txt which contains:
a|b|c|d|f
g|h|i|j|k
l|m|n|o|p
I know how to use token to split the string, but how can I parse out information from a text file, split it up and then store it into the database?
Thanks
vinnie
|
|
|
|
|
|
Daniel,
Do you have example codes? Does C++ have BCP capability?
Thank You
|
|
|
|
|
|
Thank You Daniel. I went to the site, scan thru the code a little.
I think this is what I need. You are very very helpful.
Thanks.
|
|
|
|
|
I want to develop a program in VC++, that runs in background; i mean that the program has no user interface and runs silently. The motive of this program is that it downloads certain file from internet, and when downloading completes, a dialog box is displayed. I've developed all the core logic and download coding etc. But now i want this program to run as a "silent" application in background.
Can any one tell me how can i convert my application to "invisible" form ????
|
|
|
|
|
check ShowWindow
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Papa wrote:
check ShowWindow
My program is not necessarily a windows application. I want to run it as a "process" and not "application". Just when you see windows task manager in Win2k, there are two tabs, "applications" and processes". I want to run my program as a process and not as an "application", and this difference is something that i am unable to understand
|
|
|
|
|
|
He probably will not be able to use a Service as he said he want to display a some kind of message to the use when its done.
|
|
|
|
|
if u hide the window, it stop showing in The Window tab of task manager but keep showing in the Processes tab
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
If not using MFC, then build your app as a "Windows application" (i.e. one having a WinMain entry point) and just do not create any windows at all.
If in MFC, go to the InitInstance of the program, delete the GUI stuff (for dialog-based apps, a few lines of code displaying a modal dialog) and put your code there.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You can create windows but you must not register a class or make any windows visible.
Todd Smith
|
|
|
|