SF1709841 Visual C++ 8.0 Visual Studio 2005 compilation. No longer requires VC98 or 2003 Platform SDK.

This commit is contained in:
clay_shooter
2007-04-30 02:37:00 +00:00
parent 9c23a727c2
commit e98dc4b0cf
12 changed files with 476 additions and 493 deletions

View File

@@ -291,13 +291,13 @@ JNIEXPORT jintArray JNICALL Java_com_jacob_com_Dispatch_getIDsOfNames
CoTaskMemFree(lps);
CoTaskMemFree(dispid);
char buf[1024];
strcpy(buf, "Can't map names to dispid:");
strcpy_s(buf, "Can't map names to dispid:");
for(i=0;i<l;i++)
{
USES_CONVERSION;
jstring s = (jstring)env->GetObjectArrayElement(names, i);
const char *nm = env->GetStringUTFChars(s, NULL);
strcat(buf, nm);
strcat_s(buf, nm);
env->ReleaseStringUTFChars(s, nm);
env->DeleteLocalRef(s);
}
@@ -359,13 +359,13 @@ static char* CreateErrorMsgFromInfo(HRESULT inResult, EXCEPINFO* ioInfo,
char* desc = ::BasicToCharString(ioInfo->bstrDescription);
const size_t MSG_LEN = ::strlen(methName) + ::strlen(source) + ::strlen(desc) + 128;
msg = new char[MSG_LEN];
::strncpy(msg, "Invoke of: ", MSG_LEN);
::strncat(msg, methName, MSG_LEN);
::strncat(msg, "\nSource: ", MSG_LEN);
::strncat(msg, source, MSG_LEN);
::strncat(msg, "\nDescription: ", MSG_LEN);
::strncat(msg, desc, MSG_LEN);
::strncat(msg, "\n", MSG_LEN);
::strncpy_s(msg, MSG_LEN, "Invoke of: ", strlen("Invoke of: "));
::strncat_s(msg, MSG_LEN, methName, strlen(methName));
::strncat_s(msg, MSG_LEN, "\nSource: ", strlen("\nSource: "));
::strncat_s(msg, MSG_LEN, source, strlen(source));
::strncat_s(msg, MSG_LEN, "\nDescription: ", strlen("\nDescription: "));
::strncat_s(msg, MSG_LEN, desc, strlen(desc));
::strncat_s(msg, MSG_LEN, "\n", strlen("\n"));
delete source;
delete desc;
}
@@ -374,11 +374,12 @@ static char* CreateErrorMsgFromInfo(HRESULT inResult, EXCEPINFO* ioInfo,
char* msg2 = CreateErrorMsgFromResult(inResult);
const size_t MSG_LEN = ::strlen(methName) + ::strlen(msg2) + 128;
msg = new char[MSG_LEN];
::strncpy(msg, "A COM exception has been encountered:\n"
"At Invoke of: ", MSG_LEN);
::strncat(msg, methName, MSG_LEN);
::strncat(msg, "\nDescription: ", MSG_LEN);
::strncat(msg, msg2, MSG_LEN);
::strncpy_s(msg, MSG_LEN,
"A COM exception has been encountered:\nAt Invoke of: ",
strlen("A COM exception has been encountered:\nAt Invoke of: "));
::strncat_s(msg, MSG_LEN, methName, strlen(methName));
::strncat_s(msg, MSG_LEN, "\nDescription: ", strlen("\nDescription: "));
::strncat_s(msg, MSG_LEN, msg2, strlen(msg2));
// jacob-msg 1075 - SF 1053872 : Documentation says "use LocalFree"!!
//delete msg2;
LocalFree(msg2);
@@ -415,7 +416,7 @@ JNIEXPORT jobject JNICALL Java_com_jacob_com_Dispatch_invokev
HRESULT hr;
if (FAILED(hr = name2ID(pIDispatch, nm, (long *)&dispID, lcid))) {
char buf[1024];
sprintf(buf, "Can't map name to dispid: %s", nm);
sprintf_s(buf, 1024, "Can't map name to dispid: %s", nm);
ThrowComFail(env, buf, -1);
return NULL;
}
@@ -514,7 +515,7 @@ JNIEXPORT jobject JNICALL Java_com_jacob_com_Dispatch_invokev
} else {
dispIdAsName = new char[256];
// get the id string
_itoa (dispID,dispIdAsName,10);
_itoa_s (dispID, dispIdAsName, 256,10);
//continue on mostly as before
buf = CreateErrorMsgFromInfo(hr,&excepInfo,dispIdAsName);
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright (c) 1999-2004 Sourceforge JACOB Project.
* All rights reserved. Originator: Dan Adler (http://danadler.com).
* Get more information about JACOB at http://sourceforge.net/projects/jacob-project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// stdafx.cpp : source file that includes just the standard includes
// stdafx.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#ifdef _ATL_STATIC_REGISTRY
#include <statreg.h>
#include <statreg.cpp>
#endif
#include <atlimpl.cpp>

View File

@@ -42,7 +42,7 @@
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>
//#include <atlcom.h>
//{{AFX_INSERT_LOCATION}}