for(int i=0; pwcDC[i] != NULL; i++)
//How can be the above expression can be valid one that
is the one which is checking "pwcDC[i] != NULL" in which
we may actually be doing ABR( Array bound read) or anything so.
I am begginer in this so can u help me in this ?.
I am reading a text file line by and line and reading the values into variables using sscanf. The problem I am having is that sscanf will return the correct value for the number of columns that I have, however, it only puts the first value into first variable and ignores the remaining variables.
This is a snippet of the text file I am reading:
<code>Y8145L 0 1 1
Y8148L 0 1 1</code>
This is the code snippet:
<code>while(fgets(pointListID, sizeof(pointListID), unit1File))
If you use C++ stream classes and strings instead of old non-typesafe C functions this kind of problem isn't possible. Here's a complete example with error checking:
// Console.cpp : Defines the entry point for the console application.
int main(int argc, char *argv)
using namespace std;
// Open the file.
cerr << "Failed to open input file!" << endl;
// Read in line at a time.
unsigned int LineNumber = 1;
while (getline(ifs, Line))
// Now break up the line.
int x, y, z;
if (!(iss >> PointID >> x >> y >> z))
cerr << "Error in line " << LineNumber << endl;
// Output the results to the console for testing.
cout << PointID << ": (" << x << ", " << y << ", " << z << ")" << endl;
You want to change it to read doubles. Just make the following change with no need to alter a format spec and manually make sure it matches the variables:
double x, y, z;
I want to modify the color in the bitmap displayed in a window on screen in real time, for exemple for simulating a transition night/day.
Some pixel may have their color modified, other not.
Please can you indicate how I can create some filter or lookup table in order to implement such function in Visual C++.
Use of CPalette ? Other ?
How can i convert any file format to tiff file format? Any DLL, source code or free app via command line?
Alternatively, can be a solution that convert any file to another format and later to a tiff format.
As Christian said, use GDI+. Be aware that it supports only SOME TIFF files. (Look at TIFF as a container of an image; how the image is actually formatted/compressed is essentially infinite. Before you get too alarmed, there are TIFF formats Apple has never published.) Fortunately, GDI+ handles the more common formats.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
i am using some JNI code and talking to a MFC extension DLL
I am using Visual Studio 6 . I get a crash when i try to create a window in one of the exposed functions . The crash seems to be in afxwin1.inl line 19 after the call to CreateEx
CHiddenWindow hiddenWnd ; <br />
extern"C"int APIENTRY<br />
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)<br />
// Remove this if you use lpReserved<br />
if (dwReason == DLL_PROCESS_ATTACH)<br />
TRACE0("DLLWRAPPER.DLL Initializing!\n");<br />
// Extension DLL one-time initialization<br />if (!AfxInitExtensionModule(DllWrapperDLL, hInstance))<br />
// Insert this DLL into the resource chain<br />// NOTE: If this Extension DLL is being implicitly linked to by<br />// an MFC Regular DLL (such as an ActiveX Control)<br />// instead of an MFC application, then you will want to<br />// remove this line from DllMain and put it in a separate<br />// function exported from this Extension DLL. The Regular DLL<br />// that uses this Extension DLL should then explicitly call that<br />// function to initialize this Extension DLL. Otherwise,<br />// the CDynLinkLibrary object will not be attached to the<br />// Regular DLL's resource chain, and serious problems will<br />// result.<br />new CDynLinkLibrary(DllWrapperDLL);<br />
elseif (dwReason == DLL_PROCESS_DETACH)<br />
TRACE0("DLLWRAPPER.DLL Terminating!\n");<br />
// Terminate the library before destructors are called<br />
return1; // ok<br />
JNIEXPORT jint JNICALL Java_Blah1<br />
(JNIEnv *pEnv, jclass)<br />
hiddenWnd.CreateEx(0 ,::AfxRegisterWndClass( NULL) , NULL , WS_OVERLAPPED , CRect(10,10,10,10),NULL , 0);<br />
I have a .ocx file that I am trying to install on many computers. I have found code in MSDN which shows how to register ActiveX in Visual 6.0 C++. http://msdn2.microsoft.com/en-us/library/ms177531.aspx[^] I successfully put this code into my application so before my program starts up it checks the registry to see if the activeX is installed and if it is not then it will copy the file to the C:\ and install it. This is working for admins only right now.
I copy it to the C:\ and not the system32 folder because the user that is logged on may not have admin rights to do so.
My problem is installing ActiveX will not work if the user doesn't have admin rights. I have tried with my program and using "regsvr32.exe C:\my.ocx" which returns and error stating "DllRegisterServer in C:\my.ocx failed. Return code was: 0x8002801c".
I know there is a function where I can run a batch file as another user (like an admin user) but I dont have a global admins userid and password.
Is there anyway to register an ActiveX with a less privileged user?
Last Visit: 31-Dec-99 18:00 Last Update: 27-Sep-23 19:41