|
Hi,
When I am trying to automate MS Word (32 bit) from a NT Service (32 bit). The word runs as a 64 bit application (as evident from the task manager).
But if the same code is run as a thread from a Windows application word runs as 32 bit.
How can I automate word to run as 32 bit from the NT sevice??
Thanks,
Indra
|
|
|
|
|
Hi all,
I am getting this error "Access violation at address 61102752 in module
'oracore9.dll'. Read of address 00040008." When I run my application in the IDE (debugging). Can anyone please help me? Or tell me why this is happening?
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Someone, somewhere is using a pointer to memory he is not supposed to access.
Without Code we can not say too much.
Failure is not an option - it's built right in.
|
|
|
|
|
Use the callstack to locate more precisely the problem. Then you'll be able to set breakpoints before the error occurs and check if everything is as expected.
|
|
|
|
|
Thanks for the reply ...
Firstly this only happens when when I'm using an Oracle database. Secondly my call stack is empty, but the occurance happens in this function call:
SQLRETURN ret;
SQLSMALLINT pcbConnStrOut;
if(drvConn == sqlPrompt && hWnd == NULL)
return FALSE;
if(m_lConnectionTimeout > 0)
SQLSetConnectAttr(m_hDbc, SQL_ATTR_CONNECTION_TIMEOUT, (SQLPOINTER)m_lConnectionTimeout, 0);
SQLSetConnectAttr(m_hDbc, SQL_ATTR_LOGIN_TIMEOUT, (SQLPOINTER)m_lLoginTimeout, 0);
ret = SQLDriverConnect(m_hDbc,
hWnd,
(SQLCHAR*)szConnStr,
SQL_NTS,
(SQLCHAR*)szConnStrOut,
sizeof(szConnStrOut),
&pcbConnStrOut,
(SQLUSMALLINT)drvConn);
m_bIsConnected = ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO;
return m_bIsConnected;
When trying the same thing is MySQL everything works. I have no I dea whats going wrong.
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Where does it crashes exactly in this piece of code ? Did you put breakpoints and check if the variables are correct ?
|
|
|
|
|
Variables are correct, because I call the exacpt same function (database class ODBC) a few lines back, without a problem. Please note that this only occurs in the IDE run-time debugging senario. When I compile a .exe and run it, there is no problem with it.
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: ...there is no problem with it...
...that you know of. Problems don't just go away. They can move or be masked, however.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry .. after putting in a try and catch block I received the following:
Stack:
:004B453D CODBCDatabase::DriverConnect(this=:0012E38C, szConnStr=:0055F294, szConnStrOut=NULL, hWnd=NULL, drvConn=0 /* sqlNoPrompt */)
:0040EFD0 getDUCNames()
:60601457 OraClient9.OCIServerAttach + 0x67
:08b0698b OCI.OCIServerAttach + 0x2b
:08aa6f69 ; C:\EC-Apps\OracleClient92\BIN\SQORA32.DLL
:08aa6e09 ; C:\EC-Apps\OracleClient92\BIN\SQORA32.DLL
:08aa97f6 ; C:\EC-Apps\OracleClient92\BIN\SQORA32.DLL
:08aa8c67 ; C:\EC-Apps\OracleClient92\BIN\SQORA32.DLL
:08a942ea ; C:\EC-Apps\OracleClient92\BIN\SQORA32.DLL
:74323079 ; C:\WINDOWS\system32\ODBC32.DLL
:74322fbc ; C:\WINDOWS\system32\ODBC32.DLL
:743528f9 ; C:\WINDOWS\system32\ODBC32.DLL
Occurs here at this call:
if (!pdb.DriverConnect(lpSapDsnStr))
return;
ret = SQLDriverConnect(m_hDbc,
....
Does this give a more descriptive explanation ??
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
You should check the documentation. It is probably normal that the function throw an exception if something goes wrong. If a function might throws an exception, you should always catch it.
If the problem doesn't occur in your exe, you should check the different pathes that you are using. Some of them might be wrong.
|
|
|
|
|
|
Hi,
If i declare too many local variables(DWORD, CString, other data type) in a function, would that make my program slow.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
Depends on what is it doing in the constructor codes of the data type.
Primitive data type should be harmless or at least not noticeable.
If you running out of memory, it would also slow down your program because of resort to virtual memory. (It will slow or crash even for whatever you do I think anyway)
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Depends on the variable and how it is being used.
For example, creating a DWORD and adding to it in a loop is has significantly different performance implications than adding to a CString in the same loop.
I believe it boils down more to not how many variables you have, but how you are using them. Variables that manage resources for you (like CString ) are easy to use incorrectly (or at least inefficiently).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
This Question is a typical case of "premature optimisation".
Code your program.
If its too slow determine why. A profiler would be helpful here.
Fix *that* issue.
Failure is not an option - it's built right in.
|
|
|
|
|
Technically, yes. Would you notice it? Probably not.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi to all,
if i type the item in the edit box mean it must add into the listbox.
plz gve me ideas.
|
|
|
|
|
estherpappa wrote: if i type the item in the edit box mean it must add into the listbox.
Do you mean to say that as you are typing the text in the edit box, the changes should be reflected in the list box too?
Or you mean - that once you have finished typing the text in the edit box and do some action, then only the string should be added to the list box.
If you want this then you should have a look at CListBox::SetItemText()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
If you are using MFC:
CString strText;
m_edit.GetWindowText(strText);
m_listbox.AddString(strText); If not, a Win32 example can also be provided.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hello,
I want to use OnKeyDown() for alphabets Caps and small. But what are the codes to use since for Up and Down arrows I have used VK_DOWN and VK_UP.
I have tried VK_A to VK_Z.But that doesn't work.
Thanks
|
|
|
|
|
void COnlyForU::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(nChar == 'a' || nChar == 'A')
else if(nChar =='b' || nChar == 'B')
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
I am using Windows CE platform for my flashlite plugin application development.In the registry file(.rgs),threading model is set to Both to support both the STA and MTA.
Because of the threading model, I am getting fatal error as ,
"Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The thr eading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
So, I changed the apartment type is changed to free,apartment etc.
like ThreadingModel = Both
ThreadingModel = Free
ThreadingModel = Apartment
But I am getting the same error.It is related to _WIN32_WCE macro?
Please help me to solve this error...
Siddharth
|
|
|
|
|
Are you sure you're not doing something wrong?
I am sure single-threaded COM is supported in WinCE as this is very easy to do. COM does this by using a hidden window and a message loop to serialize the calls aka com marshalling.
Do you have the source code for the COM object, can you build it for WinCE and then try to register the com object. Possibly the existing COM object was never built to run on WinCE as some one the APIs on WinCE are light-weight and don't transfer easily from Win32 platforms.. this is what I've read as I have never developed for a WinCE platform.
You can't simpley change a COM object that was STA to MTA free threading model because then your object is not thread safe and will have all kinds of data corruption bugs! You also need to build a thread safe COM object besides the registry setting.
Also STA and MTA support has nothing to do with DCOM!
Yours Truly, The One and Only!
|
|
|
|