|
You need to at least narrow down whether it is the C# application or the C++ DLL.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Hi, thanks for the response. The event log indicates it is the c++ dll that is causing the error. What else would you like to know?
|
|
|
|
|
I have seen that error when you mix 64 and 32 bit platforms. The application and the dll need to agree on their "bitness". Check your build parameters for C# to see the platform selected. If it says "Any", that means that, at runtime, it will pick the architecture best for the machine you are running on. If the dll doesn't match that, you will get this error.
|
|
|
|
|
Thank you, I will try that on Monday when I get back to work and reply back with the results.
|
|
|
|
|
|
Sorry, I don't use Visual Studio Express. In Visual Studio 1008 Enterprise it's in the Project Properties, Build tab, Platform Target field. There's a setting for both Debug and for Release. Sorry I can't post a screenshot of the relevant screen.
|
|
|
|
|
After trying many different settings in VS 2008, I downloaded a different version of the helper dll that I was using and this seems to have fixed the issue. Thank you to the two people that replied.
|
|
|
|
|
I'm experimenting with D and I'm trying to make a resource manager much like the C# one.
Now I'm hitting a problem...
How do I know the current user locale? i.e. "en-Au" / "en" ?
I found this function: GetUserDefaultLocaleName
but apparently it's only post vista... what if my program run on XP? what should I do? (I'm trying to write an installer, so I'd like to cater, at least from XP tp 7!)
I found this one too: GetUserDefaultLCID() but what am I to do with a LCID?
Is there a referenc etable I can use?
[EDIT]I just found a big table with the exhaustive list of locale...
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
modified on Thursday, June 2, 2011 12:29 PM
|
|
|
|
|
Have you tried GetLocaleInfo() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I haven't. The fact it doesn't seems to work on vista and later where I should use GetLocalInfoEx() is a problem.
But I have an exhaustive dictionary of all LCID and and their code name, much better for me!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Super Lloyd wrote: The fact it doesn't seems to work on vista and later where I should use GetLocalInfoEx() is a problem.
I'm not sure what you mean by this, but GetLocaleInfo() dates all the way back to Windows 2000, whereas GetLocaleInfoEx() works on Vista and newer.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
#define MyTemplate( filename ) "D:/Template/MyApp/" # filename
#include MyTemplate( stdafx.h ) // failed to compile
int main()
{
cout << MyTmeplate( stdafx.h ) // ok, print "D:/Template/MyApp/stdafx.h"
}
How to include files in "D:/Template/MyApp/" if I don't copy them to my own project directorie?
solution like the macro doesn't work perhaps #include instruction doesn't accept another '#' in its statement.
Could someone help me, thanks in advance!
|
|
|
|
|
I recommend you have a look at Token Concatenation[^]. That explains how to define and use a C macro to concatenate tokens.
|
|
|
|
|
Considering you're using stdafx.h, I assume you are using Visual Studio? Why not just add the include directory to Additional Include Directories in the Project Properties dialog, under the C/C++ tab. That way, there's no need for possibly troublesome macro's and makes it easier to maintain.
For other build environments there should be similar options.
|
|
|
|
|
Thank you. That's a nice solution.
|
|
|
|
|
I found another trouble, I have to include the D:\template for every individual project. Is it possible to include it like "VC98\include" as an one-time-job ?
|
|
|
|
|
In vs2005,
1. Go to Tools->Options
2. Click on projects and solutions tree item
3. Select vc++ directories item
4. Select Include files in drop down window "Show Directories for"
5. Then add your include directory.
I think it will be same in all VS IDE.
http://www.mono-project.com/Main_Page
|
|
|
|
|
void CFLUpdaterDlg::Print(CString s_Format, ...)
{
va_list args;
va_start(args, s_Format);
int BUFLEN = 1024;
CString s_Out;
TCHAR* t_Out = s_Out.GetBuffer(BUFLEN+1);
_vsntprintf(t_Out, BUFLEN, s_Format, args);
t_Out[BUFLEN] = 0;
s_Out.ReleaseBuffer();
if (s_Out.GetLength() == BUFLEN)
s_Out.Replace(_T("\r"), _T(""));
s_Out.Replace(_T("\n"), _T("\r\n"));
ms_Output += s_Out;
m_Print.SetWindowText(ms_Output);
return;
}
void CFLUpdaterDlg::OnBnClickedStartserver()
{
if(!serverstarted)
{
TCHAR PortNumber[260];
m_PortTxT.GetWindowTextA(PortNumber,260);
m_Port = atoi(PortNumber);
Print("Server Started on port %i\n",m_Port);
serverstarted=true;
AfxBeginThread( ServerEXE,(LPVOID)m_Port, THREAD_PRIORITY_NORMAL);
}
else
{
Print("Server Allready Running\n");
}
}
UINT CFLUpdaterDlg::ServerEXE(LPVOID param)
{
CFLUpdaterDlg out;
int host_port = (int)param;
out.Print("port = %i\n",host_port);
return 0;
}
i seem to be geting memory overflows it prints out OnBnClickedStartserver info no problem but when i try to print from the thread instant overflow
|
|
|
|
|
kosacid wrote: m_Port = atoi(PortNumber);
Is m_Port a pointer?
kosacid wrote: AfxBeginThread( ServerEXE,(LPVOID)m_Port, THREAD_PRIORITY_NORMAL); Why are you casting an int to a pointer? If m_Port is a global int , you'd need something like:
AfxBeginThread(ServerEXE, (LPVOID) &m_Port, THREAD_PRIORITY_NORMAL);
kosacid wrote: int host_port = (int)param;
This does not look right. If param is supposed to be treated as a pointer to an int , you'd need:
int host_port = *((int *) param); or
int *host_port = (int *) param; Also, why are you having the secondary thread interact with a UI element? Only the primary thread (the one that owns the UI element) should do that.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
it passes the param ok its not that its definitly the print function seems to be
m_Print.SetWindowText(ms_Output);
ms_Output contains say "port = 100" if i set it to 100
seems that m_Print.SetWindowText(ms_Output); cant find the edit box its pointing to 0
|
|
|
|
|
kosacid wrote: cant find the edit box its pointing to 0
No surprise since you are attempting this from a secondary thread.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
that dosent realy help me out can you maby sugest a way on how to do it
maby give me a push in the right direction i mainly program in c++ and c
what works for that dosent seem to work in visal c++
|
|
|
|
|
Like I mentioned earlier, you should refrain from interacting with any UI element from any thread other than the one that actually owns the element. See here for more, specifically the "Worker threads and the GUI II: Don't touch the GUI" section.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I work in VC6 and I need for some project atlimage.h to include in my project. My question is , where can I find it for download ? I mention that I search along for this , but I didn't find it ... can you help me ? Thank you.
|
|
|
|
|