|
hi..I'm getting this error message when i compile my program. Can anyone help me out to identify
what does the error means??
Thank you.
sqlite3.lib(shell.obj) : fatal error LNK1313: ijw/native module detected; cannot link with pure modules
|
|
|
|
|
I suppose you might get better help on the (managed) C++/CLI forum [^], anyway, have a look at [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
vanishaa wrote: Can anyone help me out to identify
what does the error means??
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
when i run the program separately without using .net.. its running fine.. but i embedded it to my program which is running on .net its failing with this error...
|
|
|
|
|
What you have is a linker error, not a runtime error.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
in the running program common language runtime support was set to no common language support. But my main program which is .NET program is set to pure MSIL common language runtime support. If I set ommon language runtime support to no common language runtime support in the main program which showing multiple error.
|
|
|
|
|
My knowledge of Managed C++ is as near to zero as you can get. You'll need to heed CPallini's advice.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
hi, there
It's my first time to post a question here to ask for help because the problem is drving me crazy. Everyone who give a direct answer or redirect-url resources is appreciable.
here is the problem:
I decide to grab web-pages from a website, what my policy is that I use a main thread to find many items in a page and i send each item to a thread to deal with. So this is a parallel muti-thread problem. and I find out that the whole process stuck somewhere and the usage of the CPU climed up to 100%. here is the main code that i think is asscociated:
<pre>
HANDLE hSemaThr,hSema,hContent;
main(){
....Handle hCont=CreateFile(....);
hSema=CREATESemaphore(0,1,1,0);
hSemaThr=CREATEMUTEX(0,10,10,0);//this Semaphore is to control thread-buildings so that there are 10 threads in the process at most
WHILE(regex_search(begin,end,stringmatch,r)){
string s=stringmatch[0];
begin=stringmatch[0].second;
WaitForSingleObject(hSemaThr,INFINITE);
CreateThread(0,0,Grab,(void*)dc,0,0);
}
CloseHandle(hCont);
}
void Grab(void* doc){
......
......
WaitForSingleObject(hSema,INFINITE);
if(!WriteFile(::hCont,lpBuf,(int)strlen(lpBuf),&lpN,0)){
cout < <"can't write file in thread" < <GetLastError() < <endl;
//system("pause");
}
ReleaseSemaphore(hSema,1,0);
WaitForSingleObject(hMutexThr,INFINITE);
CanThr--;
ReleaseSemaphore(hSemaThr,1,0);
}
</pre>
Can somebody help me!
Thanks very much!
--Jack
|
|
|
|
|
Do you ever release the mutexes you lock with WaitForSingleObject? Once you are done with it you should call ReleaseMutex[^]. Anyways, the high CPU usage can mean 2 things i think: you either make too many threads, or one or more of your threads are stuck in an infinite loop. Once your program is eating all the CPU power use your debugger to break execution and check what your threads are doing. If there are a lot of items you need to process you are probably better off using a few threads and queuing the items to them rather then creating a hundred-and-twenty-five threads for each and every item you want to process.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
sorry, when i extrat my code i forget to change some words:
here is the right one and I have release the semaphore in each thread, right in front of "return", and I know the queuing policy is better but I just want to find out what's wrong with my program,by the way at the same time there can only be 10 threads because of my semaphore controling policy.see"//"
main(){
....Handle hCont=CreateFile(....);
hSema=CREATESemaphore(0,1,1,0);
hSemaThr=CREATEMUTEX(0,10,10,0);//so there are only 10 threads at most in the same time
WHILE(regex_search(begin,end,stringmatch,r)){
string s=stringmatch[0];
begin=stringmatch[0].second;
WaitForSingleObject(hSemaThr,INFINITE);
CreateThread(0,0,Grab,(void*)dc,0,0);
}
CloseHandle(hCont);
}
void Grab(void* doc){
......
......
WaitForSingleObject(hSema,INFINITE);
if(!WriteFile(::hCont,lpBuf,(int)strlen(lpBuf),&lpN,0)){
cout < <"can't write file in thread" < <GetLastError() < <endl;
//system("pause");
}
ReleaseSemaphore(hSema,1,0);
ReleaseSemaphore(hSemaThr,1,0);
return;
}
|
|
|
|
|
Please put your code posts between <pre> and </pre> tags for better readability next time.
Did you try breaking the execution to see what your threads are doing when they gabble up the CPU?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I'm gonna include a Task Panel (something like the time when you open the Search Window within the Windows Explorer). But I think a CView object _which normally fully occupies the frame window_ is not a good container to that panel (As It's intended to be Document Viewer). I'm solicited to RESIZE the View Window within the Frame Window to fit the panel; but I'm not sure if this is a wise thought or not...
Thank you masters!
|
|
|
|
|
If you're using VC++ 2008, you can get one of those for nowt in the MFC feature pack[^] lookup CMFCTasksPane[^] in the documentation.
Otherwise - is there something in here[^] that would suit?
If none of those are what you want, I'd suggest you find an MFC docking pane implementation and put your Task panel on a docking pane. Or add a splitter to give you two views (one of which could be a form view or something that you paint your task panel on.
I guess I'm basically agreeing with you - you should add a separate window for the pane, and NOT make it part of the view.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Do the same as this C code:
int a,b,c,d;
sscanf("1234", "%1d%1d%1d%1d", &a, &b, &c, &d);
|
|
|
|
|
This would print the digits in the reverse order. Now you can store the digits in an int array and print...
int a = 0 ;
int i = 1234;
while(i!=0)
{
a = i%10;
i = i/10;
cout << a;
}
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
cin - The object controls extractions from the standard input as a byte stream
so you can use it as well.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Yeah, istringstream is ok, but is there any format control mechanism for this?
|
|
|
|
|
You might look into istringstream and num_get() . I've not tried it, however.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I have ATL COM server and a dialog based application as a client..I need to test my server on a remote machine and access the method of the server from my local client... copied the exe of the server on the remote machine and I have used CoCreateInstanceEx to create a instance of the remote server..Should i Need to do anything else..Should I create proxy/stub for my application? If so ,how can build proxy/stub?Please help me out...
Thank U...
|
|
|
|
|
RevathiRamakumar wrote: Should i Need to do anything else
Nope.
RevathiRamakumar wrote: Should I create proxy/stub for my application? If so ,how can build proxy/stub?
Nope.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank u.. But then, Im not able to connect to the remote COM...What should be wrong then?
Thank u..
|
|
|
|
|
I don't know.
You should possibly post your calling code.BTW, what was the CoCreateInstanceEx return value?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
This is my client code that calls the COM server on the remote machine...Thank u..
HRESULT hr;
IIGetFile2* pGetFile;
//
IUnknown* pUnknown = 0;
COSERVERINFO ServerInfo = {0,0,0,0};
wchar_t * remotemachine = L"servername";
ServerInfo.pwszName = remotemachine;
//MULTI_QI qi = {&__uuidof(IGetFile2),NULL,S_OK};
MULTI_QI qi={0,0,0};
qi.pIID = &IID_IUnknown;
//
IIGetFile2 * pInt = static_cast<IIGetFile2 *>(qi.pItf);
USES_CONVERSION;
CComPtr<IIGetFile2> Ptr1;
qi.pIID = &IID_IIGetFile2;
//
hr = CoCreateInstanceEx(CLSID_IGetFile2,NULL,CLSCTX_REMOTE_SERVER,&ServerInfo,1, &qi);
pUnknown = (IUnknown*)qi.pItf;
if(SUCCEEDED(hr))
{
AfxMessageBox("SUCCEEDED CoCreateEX");
}
pUnknown = (IUnknown*)qi.pItf;
hr = pUnknown->QueryInterface(IID_IIGetFile2, (void**)&pGetFile);
hr = pUnknown->Release();
if(SUCCEEDED(hr))
{
AfxMessageBox("SUCCEEDED QI");
_bstr_t bstrFileContent = pGetFile->GetFile2();
char* Text = _com_util::ConvertBSTRToString(bstrFileContent);
m_edit=Text;
UpdateData(FALSE);
}
|
|
|
|
|